Skip to content

Instantly share code, notes, and snippets.

@mneil
Last active August 29, 2015 14:03
Show Gist options
  • Save mneil/fc699650f6472c746d99 to your computer and use it in GitHub Desktop.
Save mneil/fc699650f6472c746d99 to your computer and use it in GitHub Desktop.
Capistrano Production deploy by Tag
role :app, %w{[email protected]}
role :app, %w{[email protected]}
role :app, %w{[email protected]}
set :deploy_to, '/home/user/wp'
server '0.0.0.0', user: 'user', roles: %w{web app}
set :branch do
default_tag = `git tag`.split("\n").last
tag = Capistrano::CLI.ui.ask "Tag to deploy (make sure to push the tag first): [#{default_tag}] "
tag = default_tag if tag.empty?
tag
end
server '0.0.0.0',
user: 'user',
roles: %w{web app},
ssh_options: {
user: 'user', # overrides user setting above
keys: %w(~/.ssh/id_rsa),
forward_agent: true,
auth_methods: %w(publickey password)
# password: 'please use keys'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment