Skip to content

Instantly share code, notes, and snippets.

@thotmx
Last active August 29, 2015 14:01
Show Gist options
  • Save thotmx/c7cd1dcc41511c10ab63 to your computer and use it in GitHub Desktop.
Save thotmx/c7cd1dcc41511c10ab63 to your computer and use it in GitHub Desktop.
config/deploy.rb
set :application, 'prueba'
set :scm, "git"
set :repo_url, "git@github.com:LogicalBricks/prueba.git"
set :deploy_to, "/home/deployer/apps/#{fetch(:application)}"
set :ssh_options, {
forward_agent: true
}
set :log_level, :debug
set :linked_files, %w{config/database.yml config/secrets.yml}
set :linked_dirs, %w{bin log tmp vendor/bundle public/system public/uploads}
SSHKit.config.command_map[:rake] = "bundle exec rake"
SSHKit.config.command_map[:rails] = "bundle exec rails"
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 'deploy:publishing', 'deploy:restart'
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
end
end
after :finishing, 'deploy:cleanup'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment