lewagon/middleman-deploy

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

Homepage:

Size: 133

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Middleman Deploy

Deploy your Middleman build via rsync, ftp, sftp, or git (e.g. gh-pages on github).

Installation
'middleman-deploy', '~> 1.0'
Usage
ddleman build [--clean]
ddleman deploy [--build-before]
Possible Configurations

Middleman-deploy can deploy a site via rsync, ftp, sftp, or git. Checkout the wiki for advanced set-up options.

Rsync

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

Git (e.g. GitHub Pages)

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.

FTP

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'

SFTP

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

Run Automatically

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

Multiple Environments

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
Badges

Gem Version Build Status Code Quality Code Coverage Gittip

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

Credits

A BIG thanks to everyone who has contributed! Almost all pull requests are accepted.

Inspiration:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.