2012-08-30 09:43:12 -07:00
|
|
|
Middleman Delpoy -- Deploy a [middleman](http://middlemanapp.com/) built site over rsync or to github pages.
|
2012-08-20 16:42:11 -07:00
|
|
|
|
2012-08-22 10:06:47 -07:00
|
|
|
[![Build Status](https://secure.travis-ci.org/tvaughan/middleman-deploy.png)](http://travis-ci.org/tvaughan/middleman-deploy)
|
|
|
|
|
2012-08-20 16:42:11 -07:00
|
|
|
===
|
|
|
|
|
|
|
|
## QUICK START
|
|
|
|
|
2012-08-30 09:34:16 -04:00
|
|
|
If deploying through `rsync`, be sure it is installed.
|
2012-08-20 16:42:11 -07:00
|
|
|
|
|
|
|
### Step 1
|
|
|
|
|
|
|
|
gem install middleman-deploy
|
|
|
|
|
|
|
|
### Step 2
|
|
|
|
|
|
|
|
middleman init example-site
|
|
|
|
cd example-site
|
|
|
|
|
|
|
|
### Step 3
|
|
|
|
|
|
|
|
Edit `Gemfile`, and add:
|
|
|
|
|
2012-09-04 10:30:52 -07:00
|
|
|
gem "middleman-deploy", "~>0.0.1"
|
2012-08-20 16:42:11 -07:00
|
|
|
|
|
|
|
Then run:
|
|
|
|
|
|
|
|
bundle install
|
|
|
|
|
2012-08-30 09:34:16 -04:00
|
|
|
### Step 4a - Rsync setup
|
2012-08-20 16:42:11 -07:00
|
|
|
|
|
|
|
#### These settings are required.
|
|
|
|
|
2012-08-22 16:30:54 -07:00
|
|
|
Edit `config.rb`, and add:
|
2012-08-20 16:42:11 -07:00
|
|
|
|
|
|
|
activate :deploy do |deploy|
|
2012-08-30 09:34:16 -04:00
|
|
|
deploy.method = :rsync
|
2012-09-04 10:30:52 -07:00
|
|
|
deploy.user = "tvaughan"
|
|
|
|
deploy.host = "www.example.com"
|
|
|
|
deploy.path = "/srv/www/site"
|
2012-08-20 16:42:11 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
Adjust these values accordingly.
|
|
|
|
|
|
|
|
#### These settings are optional.
|
|
|
|
|
2012-08-20 16:47:42 -07:00
|
|
|
To use a particular SSH port, add:
|
2012-08-20 16:42:11 -07:00
|
|
|
|
|
|
|
deploy.port = 5309
|
|
|
|
|
2012-08-20 16:47:42 -07:00
|
|
|
Default is `22`.
|
|
|
|
|
2012-08-22 16:17:25 -07:00
|
|
|
To remove orphaned files or directories on the remote host, add:
|
2012-08-20 16:42:11 -07:00
|
|
|
|
2012-08-22 16:17:25 -07:00
|
|
|
deploy.clean = true
|
2012-08-20 16:42:11 -07:00
|
|
|
|
2012-08-20 16:47:42 -07:00
|
|
|
Default is `false`.
|
|
|
|
|
2012-09-04 10:30:52 -07:00
|
|
|
### Step 4b - GitHub Pages setup
|
2012-08-30 09:34:16 -04:00
|
|
|
|
|
|
|
Edit `config.rb`, and add:
|
|
|
|
|
|
|
|
activate :deploy do |deploy|
|
|
|
|
deploy.method = :git
|
|
|
|
end
|
|
|
|
|
|
|
|
The git deploy method assumes your project is in a repository with
|
|
|
|
github set up as `origin` and a working `gh-pages` branch already in place.
|
|
|
|
|
2012-08-20 16:42:11 -07:00
|
|
|
### Step 5
|
|
|
|
|
2012-09-04 10:30:52 -07:00
|
|
|
middleman build [--clean]
|
2012-08-20 16:42:11 -07:00
|
|
|
middleman deploy
|
2012-08-20 16:56:13 -07:00
|
|
|
|
|
|
|
### NOTES
|
|
|
|
|
|
|
|
Inspired by the rsync task in [Octopress](https://github.com/imathis/octopress).
|