Name: middleman-deploy
Owner: Le Wagon
Description: Deploy a middleman built site over rsync, ftp, stfp, or git (e.g. gh-pages on github).
Forked from: middleman-contrib/middleman-deploy
Created: 2017-07-25 15:52:16.0
Updated: 2018-05-11 11:04:11.0
Pushed: 2017-07-25 15:56:32.0
Size: 133
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Deploy your Middleman build via rsync, ftp, sftp, or git (e.g. gh-pages on github).
'middleman-deploy', '~> 1.0'
ddleman build [--clean]
ddleman deploy [--build-before]
Middleman-deploy can deploy a site via rsync, ftp, sftp, or git. Checkout the wiki for advanced set-up options.
Make sure that rsync
is installed, and activate the extension by adding the
following to config.rb
:
vate :deploy do |deploy|
ploy.deploy_method = :rsync
ploy.host = 'www.example.com'
ploy.path = '/srv/www/site'
Optional Settings
deploy.user = 'tvaughan' # no default
deploy.port = 5309 # ssh port, default: 22
deploy.clean = true # remove orphaned files on remote host, default: false
deploy.flags = '-rltgoDvzO --no-p --del' # add custom flags, default: -avz
Make sure that git
is installed, and activate the extension by adding the
following to config.rb
:
vate :deploy do |deploy|
ploy.deploy_method = :git
Optional Settings
deploy.remote = 'custom-remote' # remote name or git url, default: origin
deploy.branch = 'custom-branch' # default: gh-pages
deploy.strategy = :submodule # commit strategy: can be :force_push or :submodule, default: :force_push
deploy.commit_message = 'custom-message' # commit message (can be empty), default: Automated commit at `timestamp` by middleman-deploy `version`
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'.
Afterwards, the build
directory will become a git repo.
If you use the force push strategy, this branch will be created on the remote if
it doesn't already exist.
But if you use the submodule strategy, you must first initialize build folder as
a submodule. See git submodule add
documentation.
Activate the extension by adding the following to config.rb
:
vate :deploy do |deploy|
ploy.deploy_method = :ftp
ploy.host = 'ftp.example.com'
ploy.path = '/srv/www/site'
ploy.user = 'tvaughan'
ploy.password = 'secret'
Activate the extension by adding the following to config.rb
:
vate :deploy do |deploy|
ploy.deploy_method = :sftp
ploy.host = 'sftp.example.com'
ploy.port = 22
ploy.path = '/srv/www/site'
Optional Settings
deploy.user = 'tvaughan' # no default
deploy.password = 'secret' # no default
To automatically run middleman build
during middleman deploy
, turn on the
build_before
option while activating the deploy extension:
vate :deploy do |deploy|
...
ploy.build_before = true # default: false
Deploy your site to more than one configuration using environment variables.
nfig.rb
ENV['TARGET'].to_s.downcase
'production'
tivate :deploy do |deploy|
deploy.deploy_method = :rsync
deploy.host = 'www.example.com'
deploy.path = '/srv/www/production-site'
d
tivate :deploy do |deploy|
deploy.deploy_method = :rsync
deploy.host = 'staging.example.com'
deploy.path = '/srv/www/staging-site'
d
uby
kefile
space :deploy do
f deploy(env)
puts "Deploying to #{env}"
system "TARGET=#{env} bundle exec middleman deploy"
d
sk :staging do
deploy :staging
d
sk :production do
deploy :production
d
ke deploy:staging
ke deploy:production
This library aims to support and is tested against the following Ruby implementations:
A BIG thanks to everyone who has contributed! Almost all pull requests are accepted.
Inspiration: