Last active
October 10, 2018 16:49
-
-
Save sadikay/4fbe18789212536aaa134d0c5c3087de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server 'staging-ip', user: 'staging-user', roles: %w{app db} | |
set :branch, ENV['BRANCH'] | |
set :application, 'application-name' | |
set :repo_url, "[email protected]:your-repo-git-url.git" | |
set :deploy_to, "/home/ubuntu/apps/#{fetch(:application)}/#{fetch(:branch)}" | |
set :keep_releases, 1 | |
set :copy_exclude, %w(.git/* tmp/*) | |
set :linked_dirs, %w{log tmp/pids tmp/cache vendor/bundle tmp/sockets} | |
set :rbenv_type, :user | |
set :rbenv_ruby, File.read('.ruby-version').to_s.strip | |
# make sure assets precompile even in app role | |
set :assets_roles, [:web, :app] | |
set :puma_env, 'production' | |
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 | |
after :finished, 'deploy:cleanup' | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment