Using Capistrano to deploy from Unfuddle
Capistrano is a deployment tool for Ruby based applications. We need to take care that we create a set of ssh keys, add that to our local system, repository and the server where the code needs to be deployed. The Capistrano recipe in our deploy.rb looks something like below.
#helps to read the public key from the repository
default_run_options[:pty] = true
set :use_sudo, true
#Application Settings
set :synchronous_connect, true
set :application, “methell”
#Source Repository Settings
set :scm, :git
set :branch, “master”
set :repository, “git@safewlabs.unfuddle.com:safewlabs/methell.git”
#Server Options
set :deploy_to, “/var/www/#{application}”
set :domain, “www.methell.com”
set :deploy_via, :copy
set :copy_exclude, [".git"]
set :ssh_options, { :forward_agent => true }
set :user, “root”
set :use_sudo, “true”
role :app, domain
role :web, domain
role :db, domain,:primary = true
#Phusion Passenger Restart Options
namespace :passenger do
desc “Restart Application”
task :restart do
run “touch #{current_path}/tmp/restart.txt”
end
end
namespace :deploy do
task :restart,:roles => :app, :except => { :no_release => true } do passenger.restart
end
end
-
howardtharp likes this
-
rubyloveinfo likes this
-
technoholix posted this
Technoloholix is blog of people who are just curious about how stuff works and like to share their rants through this blog.