mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-01 07:45:01 -04:00
improved documentaiton for setup and deployment
This commit is contained in:
parent
98d2b410fe
commit
85fd1ed2dc
14
source/docs/deploying/_self_hosted_git.markdown
Normal file
14
source/docs/deploying/_self_hosted_git.markdown
Normal file
@ -0,0 +1,14 @@
|
||||
<h2 id="self_hosted_git">Host Your Own Remote Repository</h2>
|
||||
|
||||
If you want to set up a private git repository on your own server, here's how you'd do it. You'll need SSH access to follow along.
|
||||
|
||||
```sh
|
||||
ssh user@host.com
|
||||
mkdir -p git/octopress.git
|
||||
cd git/octopress.git
|
||||
git init --bare
|
||||
pwd # print the working directory, you'll need it below.
|
||||
logout
|
||||
```
|
||||
|
||||
The url for your remote repository is `ssh://user@host.com/(output of pwd above)`
|
@ -1,3 +1,5 @@
|
||||
<h2 id="deploy_subdir">Deploying to a Subdirectory</h2>
|
||||
|
||||
If you're deploying to a subdirectory on your site, or if you're using Github's project pages, make sure you set up your urls correctly in your configs.
|
||||
You can do this *almost* automatically:
|
||||
|
||||
@ -19,23 +21,23 @@ Then update your `_config.yml` and `Rakefile` as follows:
|
||||
```
|
||||
|
||||
To manually configure deployment to a subdirectory, you'll change `_config.yml`, `config.rb` and `Rakefile`.
|
||||
Here's an example for deploying the Octopress website to Github Project Pages:
|
||||
Here's an example for deploying a site to the /awesome subdirectory:
|
||||
|
||||
``` sh
|
||||
# _config.yml
|
||||
destination: public/octopress
|
||||
url: http://imathis.github.com/octopress
|
||||
subscribe_rss: /octopress/atom.xml
|
||||
root: /octopress
|
||||
destination: public/awesome
|
||||
url: http://example.com/awesome
|
||||
subscribe_rss: /awesome/atom.xml
|
||||
root: /awesome
|
||||
|
||||
# config.rb - for Compass & Sass
|
||||
http_path = "/octopress"
|
||||
http_images_path = "/octopress/images"
|
||||
http_fonts_path = "/octopress/fonts"
|
||||
css_dir = "public/octopress/stylesheets"
|
||||
http_path = "/awesome"
|
||||
http_images_path = "/awesome/images"
|
||||
http_fonts_path = "/awesome/fonts"
|
||||
css_dir = "public/awesome/stylesheets"
|
||||
|
||||
# Rakefile
|
||||
public_dir = "public/octopress"
|
||||
public_dir = "public/awesome"
|
||||
# If deploying with rsync, update your Rakefile path
|
||||
document_root = "~/yoursite.com/your/path"
|
||||
document_root = "~/yoursite.com/awesome"
|
||||
```
|
||||
|
@ -6,37 +6,87 @@ sidebar: false
|
||||
footer: false
|
||||
---
|
||||
|
||||
To setup deployment, you'll want to clone your target repository into the `_deploy` directory in your Octopress project.
|
||||
If you're using Github user or organization pages, clone the repository `git@github.com:username/username.github.com.git`.
|
||||
## With Github User/Organization pages
|
||||
|
||||
### With Github User/Organization pages
|
||||
Use this if you want to host a blog from `http://username.github.com` (though you can also use [custom domains](#custom_domains)).
|
||||
|
||||
Create a [new Github repository](https://github.com/repositories/new) and name the repository with your user name or organization name `username.github.com` or `organization.github.com`.
|
||||
|
||||
Github Pages for users and organizations uses the master branch like the public directory on a web server, serving up the files at your Pages url `http://username.github.com`.
|
||||
As a result, you'll want to work on the source for your blog in the source branch and commit *the generated content* to the master branch. Octopress has a configuration task that helps you set all this up.
|
||||
|
||||
``` sh
|
||||
git clone git@github.com:username/username.github.com _deploy
|
||||
rake config_deploy[master]
|
||||
rake config_github_pages
|
||||
```
|
||||
|
||||
### With Github Project pages (gh-pages)
|
||||
This will:
|
||||
|
||||
1. Ask you for your Github Pages repository url.
|
||||
2. Rename the remote pointing to imathis/octopress from 'origin' to 'octopress'
|
||||
3. Add your Github Pages repository as the default origin remote.
|
||||
4. Switch the active branch from master to source.
|
||||
5. Configure your blog's url according to your repository.
|
||||
6. Setup a master branch in the _deploy directory for deployment.
|
||||
|
||||
Next run:
|
||||
|
||||
```sh
|
||||
rake generate
|
||||
rake deploy
|
||||
```
|
||||
|
||||
This will generate your blog, copy the generated files into `_deploy/`, add them to git, commit and push them up to the master branch. In a few seconds you should get an email
|
||||
from Github telling you that your commit has been received and will be published on your site.
|
||||
|
||||
**Don't forget** to commit the source for your blog.
|
||||
|
||||
```sh
|
||||
git add .
|
||||
git commit -m 'your message'
|
||||
git push origin source
|
||||
```
|
||||
|
||||
**Note:** With new repositories, Github sets the default branch based on the branc you push first, and it looks there for the generated site content.
|
||||
If you're having trouble getting Github to publish your site, go to the admin panel for your repository and make sure that the master branch is the default branch.
|
||||
|
||||
## With Github Project pages (gh-pages)
|
||||
|
||||
Github's Project Pages service allows you to host a site for your existing open source project.
|
||||
Github will look for a `gh-pages` branch in your project's repository and make the contents available at url like `http://username.github.com/project`.
|
||||
|
||||
Here's now you can set up Octopress site to publish to your projects gh-pages repository:
|
||||
|
||||
``` sh
|
||||
git clone git@github.com:username/project.git _deploy
|
||||
rake config_deploy[gh-pages]
|
||||
rake config_github_pages
|
||||
```
|
||||
|
||||
The `config_deploy` rake task takes a branch name as an argument and creates a [new empty branch](http://book.git-scm.com/5_creating_new_empty_branches.html), and adds an initial commit.
|
||||
This also sets `deploy_default = "push"` in your `_config.yml` and prepares your branch for easy deployment. The `rake deploy` task copies the generated blog from the `public` directory to the `_deploy` directory, adds new files, removes old files, sets a commit message, and pushes to Github.
|
||||
Github will queue your site for publishing (which usually occurs instantly or within minutes if it's your first commit).
|
||||
This will:
|
||||
|
||||
Now you should be set up to deploy, just run
|
||||
1. Ask you for the repository url for your project.
|
||||
2. Rename the remote pointing to imathis/octopress from 'origin' to 'octopress'
|
||||
3. Configure your blog for deploying to a subdirectory.
|
||||
4. Set up a gh-pages branch for your project in the _deploy directory, ready for deployment.
|
||||
|
||||
``` sh
|
||||
rake generate # If you haven't generated your blog yet
|
||||
rake deploy # Pushes your generated blog to Github
|
||||
Next run:
|
||||
|
||||
```sh
|
||||
rake generate
|
||||
rake deploy
|
||||
```
|
||||
|
||||
<h2 id="deploy_subdir">Deploying to a Subdirectory (Github Project Pages does this)</h2>
|
||||
This will generate your blog, copy the generated files into `_deploy/`, add them to git, commit and push them up to the master branch. In a few seconds you should get an email
|
||||
from Github telling you that your commit has been received and will be published on your site.
|
||||
|
||||
{% render_partial docs/deploying/_subdir.markdown %}
|
||||
Now you have a place to commit the generated content for your site, but you should also set up repository to store the source for your blog.
|
||||
After you set up a repository for your blog source, add it as the origin remote.
|
||||
|
||||
```sh
|
||||
git remote add origin (your repo url)
|
||||
# set your new origin as the default branch
|
||||
git config branch.master.remote origin
|
||||
```
|
||||
|
||||
Now push your changes and you'll be all set.
|
||||
|
||||
<h2 id="custom_domains">Custom Domains</h2>
|
||||
|
||||
|
@ -9,7 +9,12 @@ footer: false
|
||||
If you don't already have a Heroku account, [create one](https://api.heroku.com/signup), it's free. Then install the Heroku gem.
|
||||
|
||||
## Basic Octopress setup
|
||||
{% render_partial docs/setup/_basic.markdown %}
|
||||
|
||||
First make sure you've installed the Heroku gem
|
||||
|
||||
```sh
|
||||
gem install heroku
|
||||
```
|
||||
|
||||
Next create a heroku app for deployment. If this is your first time using Heroku, this command will ask for your account credentials,
|
||||
and automatically upload your public SSH key. If you don't already have a public key follow [Github's guide and create one](http://help.github.com/set-up-git-redirect/).
|
||||
@ -20,4 +25,18 @@ heroku create
|
||||
|
||||
This will create a new Heroku app for you to deploy to and add a git remote named 'heroku'.
|
||||
|
||||
git config branch.master.remote origin
|
||||
```sh
|
||||
# Set heroku to be the default remote for push/fetch
|
||||
git config branch.master.remote heroku
|
||||
```
|
||||
|
||||
Edit the `.gitignore` in the root of your repository and remove `public`. This will let you add generated content for deploying it to Heroku.
|
||||
|
||||
```sh
|
||||
rake generate
|
||||
git add .
|
||||
git commit -m 'site updated'
|
||||
git push heroku master
|
||||
```
|
||||
|
||||
That's it, you just deployed to Heroku. If you want to set up a custom domain check out the [docs at Heroku](http://devcenter.heroku.com/articles/custom-domains).
|
||||
|
@ -24,25 +24,3 @@ If you have web hosting service you can probably deploy with [Rsync](http://en.w
|
||||
If your host doesn't offer SSH access, and you're looking for one that does, check out [Dreamhost](http://www.dreamhost.com/r.cgi?109007) (I've been a happy customer since 2005).
|
||||
|
||||
[Deploying with Rsync »](/docs/deploying/rsync)
|
||||
|
||||
## Host your own remote repository
|
||||
|
||||
If you want to set up a private git repository on your own server, here's how you'd do it. You'll need SSH access to follow along.
|
||||
|
||||
```sh
|
||||
ssh user@host.com
|
||||
mkdir -p git/octopress.git
|
||||
cd git/octopress.git
|
||||
git init --bare
|
||||
pwd # print the working directory, you'll need it below.
|
||||
logout
|
||||
```
|
||||
|
||||
The origin remote currently points to the Octopress project on Github but you'll want to point it to your remote repository.
|
||||
|
||||
```sh
|
||||
git remote rename origin octopress
|
||||
git remote add origin ssh://user@host.com/(output of pwd above)
|
||||
git config branch.master.remote origin
|
||||
```
|
||||
|
||||
|
@ -25,3 +25,21 @@ Now if you run
|
||||
|
||||
in your terminal, your `public` directory will be synced to your server's document root.
|
||||
|
||||
## Version control
|
||||
|
||||
You'll want to keep your blog source in a remote git repository,
|
||||
so either [set up a Github repository](https://github.com/repositories/new) or [host your own](#self_hosted_git) and then do this.
|
||||
|
||||
```sh
|
||||
# Since you cloned Octopress, you'll need to change the origin remote
|
||||
git remote rename origin octopress
|
||||
git remote add origin (your repository url)
|
||||
# set your new origin as the default branch
|
||||
git config branch.master.remote origin
|
||||
```
|
||||
|
||||
|
||||
{% render_partial docs/deploying/_self_hosted_git.markdown %}
|
||||
|
||||
{% render_partial docs/deploying/_subdir.markdown %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user