Skip to content

Instantly share code, notes, and snippets.

@michiels

michiels/deploy.rb

Last active Aug 29, 2015
Embed
What would you like to do?
intercity CLI deploy.rb
set :application, 'APPNAME'
set :repo_url, 'git@github.com:YOU/APPNAME.git'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/u/apps/APPNAME'
# Use agent forwarding for SSH so you can deploy with the SSH key on your workstation.
set :ssh_options, {
forward_agent: true
}
# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
set :linked_dirs, %w{.rbenv-vars bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# Default value for default_env is {}
set :default_env, { path: "/opt/rbenv/shims:$PATH" }
set :bundle_bins, fetch(:bundle_bins, []).push("unicorn")
# Default value for keep_releases is 5
# set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, :restart
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment