Skip to content

Instantly share code, notes, and snippets.

@binaryphile
Created December 4, 2013 22:00
Show Gist options
  • Save binaryphile/7796381 to your computer and use it in GitHub Desktop.
Save binaryphile/7796381 to your computer and use it in GitHub Desktop.
set :application, 'redmine'
set :repo_url, 'git://github.com/binaryphile/redmine'
set :branch, '2.3-stable'
set :deploy_to, '/var/www/redmine'
# set :scm, :git
# set :format, :pretty
# set :log_level, :debug
# set :pty, true
# set :linked_files, %w{config/database.yml}
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# set :keep_releases, 5
require "pathname"
namespace :deploy do
namespace :symlink do
task :release do
deploy_to_pathname = Pathname.new(deploy_to)
latest_release_pathname = Pathname.new(latest_release)
relative_latest_release = latest_release_pathname.relative_path_from(deploy_to_pathname)
binding.pry
run "rm -f #{current_path} && ln -s #{relative_latest_release} #{current_path}"
end
end
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :touch, release_path.join('tmp/restart.txt')
end
end
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
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