2013-05-06 02:49:05 +02:00
|
|
|
Middleman Deploy - Deploy a [middleman](http://middlemanapp.com/)
|
|
|
|
built site over rsync, ftp, or git (e.g. gh-pages on github).
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2012-08-22 19:06:47 +02:00
|
|
|
[![Build Status](https://secure.travis-ci.org/tvaughan/middleman-deploy.png)](http://travis-ci.org/tvaughan/middleman-deploy)
|
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
# QUICK START
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
## Step 1
|
2012-08-21 01:42:11 +02:00
|
|
|
|
|
|
|
middleman init example-site
|
|
|
|
cd example-site
|
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
## Step 2
|
2012-08-21 01:42:11 +02:00
|
|
|
|
|
|
|
Edit `Gemfile`, and add:
|
|
|
|
|
2013-05-06 02:14:12 +02:00
|
|
|
gem "middleman-deploy", "~> 0.0.12"
|
2012-08-21 01:42:11 +02:00
|
|
|
|
|
|
|
Then run:
|
|
|
|
|
|
|
|
bundle install
|
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
## Step 3a - Rsync setup
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2012-10-04 20:22:16 +02:00
|
|
|
First be sure that `rsync` is installed.
|
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
**These settings are required.**
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2012-08-23 01:30:54 +02:00
|
|
|
Edit `config.rb`, and add:
|
2012-08-21 01:42:11 +02:00
|
|
|
|
|
|
|
activate :deploy do |deploy|
|
2012-08-30 15:34:16 +02:00
|
|
|
deploy.method = :rsync
|
2012-09-04 19:30:52 +02:00
|
|
|
deploy.user = "tvaughan"
|
|
|
|
deploy.host = "www.example.com"
|
|
|
|
deploy.path = "/srv/www/site"
|
2012-08-21 01:42:11 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Adjust these values accordingly.
|
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
**These settings are optional.**
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2012-08-21 01:47:42 +02:00
|
|
|
To use a particular SSH port, add:
|
2012-08-21 01:42:11 +02:00
|
|
|
|
|
|
|
deploy.port = 5309
|
|
|
|
|
2012-08-21 01:47:42 +02:00
|
|
|
Default is `22`.
|
|
|
|
|
2012-08-23 01:17:25 +02:00
|
|
|
To remove orphaned files or directories on the remote host, add:
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2012-08-23 01:17:25 +02:00
|
|
|
deploy.clean = true
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2012-08-21 01:47:42 +02:00
|
|
|
Default is `false`.
|
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
## Step 3b - Git setup
|
|
|
|
|
|
|
|
First be sure that `git` is installed.
|
|
|
|
|
|
|
|
**These settings are required.**
|
2012-10-04 20:22:16 +02:00
|
|
|
|
2012-08-30 15:34:16 +02:00
|
|
|
Edit `config.rb`, and add:
|
|
|
|
|
|
|
|
activate :deploy do |deploy|
|
|
|
|
deploy.method = :git
|
|
|
|
end
|
|
|
|
|
2012-12-02 00:52:26 +01:00
|
|
|
By default this will deploy to the `gh-pages` branch on the `origin`
|
|
|
|
remote. The `build` directory will become a git repo.
|
2012-11-28 11:31:04 +01:00
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
**These settings are optional.**
|
2012-10-04 20:22:16 +02:00
|
|
|
|
|
|
|
To use a particular remote, add:
|
|
|
|
|
|
|
|
deploy.remote = "some-other-remote-name"
|
|
|
|
|
2012-12-02 00:52:26 +01:00
|
|
|
Default is `origin`. This can be a remote name or a git url.
|
|
|
|
|
|
|
|
If you use a remote name, you must first add it using `git remote
|
|
|
|
add`. Run `git remote -v` to see a list of possible remote names. If
|
|
|
|
you use a git url, it must end with '.git'.
|
2012-10-04 20:22:16 +02:00
|
|
|
|
|
|
|
To use a particular branch, add:
|
|
|
|
|
|
|
|
deploy.branch = "some-other-branch-name"
|
|
|
|
|
2012-12-02 00:52:26 +01:00
|
|
|
Default is `gh-pages`. This branch will be created on the remote if it
|
|
|
|
doesn't already exist.
|
2012-08-30 15:34:16 +02:00
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
## Step 3c - FTP setup
|
2012-11-08 16:45:57 +01:00
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
**These settings are required.**
|
2012-11-08 16:45:57 +01:00
|
|
|
|
|
|
|
Edit `config.rb`, and add:
|
|
|
|
|
|
|
|
activate :deploy do |deploy|
|
|
|
|
deploy.method = :ftp
|
|
|
|
deploy.host = "ftp.example.com"
|
|
|
|
deploy.user = "tvaughan"
|
|
|
|
deploy.password = "secret"
|
|
|
|
deploy.path = "/srv/www/site"
|
|
|
|
end
|
|
|
|
|
|
|
|
Adjust these values accordingly.
|
|
|
|
|
2013-06-08 22:46:43 +02:00
|
|
|
## Step 3d - SFTP setup
|
|
|
|
|
|
|
|
**These settings are required.**
|
|
|
|
|
|
|
|
Edit `config.rb`, and add:
|
|
|
|
|
|
|
|
activate :deploy do |deploy|
|
|
|
|
deploy.method = :sftp
|
|
|
|
deploy.host = "ftp.example.com"
|
|
|
|
deploy.user = "tvaughan"
|
|
|
|
deploy.password = "secret"
|
|
|
|
deploy.path = "/srv/www/site"
|
|
|
|
end
|
|
|
|
|
|
|
|
Adjust these values accordingly.
|
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
## Step 4
|
2012-08-21 01:42:11 +02:00
|
|
|
|
2012-09-04 19:30:52 +02:00
|
|
|
middleman build [--clean]
|
2013-06-11 06:42:12 +02:00
|
|
|
middleman deploy [--clean --build-before]
|
|
|
|
|
|
|
|
To run `middleman build` before `middleman deploy`, add:
|
|
|
|
|
|
|
|
deploy.build_before = true
|
|
|
|
|
|
|
|
Default is `false`.
|
2012-08-21 01:56:13 +02:00
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
## NOTES
|
2012-11-14 00:29:20 +01:00
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
When the `--clean` or `--no-clean` option is passed to `middleman
|
|
|
|
build` it will not be passed to `middleman deploy`. For now only the
|
|
|
|
value of `deploy.clean` in `config.rb` will be used.
|
2012-08-21 01:56:13 +02:00
|
|
|
|
2013-05-06 02:49:05 +02:00
|
|
|
Inspired by the rsync task in
|
|
|
|
[Octopress](https://github.com/imathis/octopress).
|