Created
March 16, 2011 10:15
-
-
Save bka/872281 to your computer and use it in GitHub Desktop.
Sample Capistrano deloyment config
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
set :application, "....." | |
set :deploy_to, "......" | |
set :scm, :subversion | |
set :deploy_via, :checkout | |
set :user, "SECRET" | |
set :password, "SECRECT" | |
set :use_sudo, true | |
set :svn_user, "SECRECT" | |
set :svn_password, "SECRECT" | |
set :repository, "file:///.........../trunk/." | |
set :local_repository, "svn+ssh://SECRECT@HOST/........../trunk" | |
role :web, "HOST" | |
role :app, "HOST" | |
role :db, "HOST", :primary => true | |
role :db, "HOST" | |
namespace :deploy do | |
task :start do ; end | |
task :stop do ; end | |
task :clean do | |
to_del = Array.new | |
run "ls #{deploy_to}/releases" do |channel,stream,data| | |
result = data.to_s | |
result.split("\n").each do |r| | |
to_del.push(r.to_i) | |
end | |
end | |
to_del = to_del.sort{|x,y| y <=> x } | |
to_del.delete_at(0) | |
to_del.each do |d| | |
run "rm -rf #{deploy_to}/releases/"+d.to_s | |
end | |
end | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
run "#{try_sudo} /etc/init.d/thin restart" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment