Adhearsion deployment scripts for Capistrano

15 views
Skip to first unread message

Jan Kubr

unread,
May 15, 2008, 12:19:30 PM5/15/08
to adhea...@googlegroups.com
Hi all,
I thought I'd share my deployment recipe for Capistrano as the only
message in this group hasn't been answered and googling didn't help
much either.
Not that there would be anything too difficult:) I did whatever I'd do
for a Rails app (http://capify.org/getting-started/rails), except
(from deploy.rb):

namespace :deploy do

task :finalize_update do
run "chmod -R g+w #{release_path}"
run "rm -rf #{release_path}/log && ln -s #{deploy_to}/shared/log
#{release_path}/log"
end

task :restart, :roles => :app do
run "#{deploy_to}/shared/system/stop"
run "#{deploy_to}/shared/system/start"
end

end


":finalize_update" does a bunch of things for Rails you don't need for
Adhearsion (like linking the "public" directory etc). The above seems
to be enough.

":restart" calls these two simple scripts:

start:
ahn start daemon /home/ahn/call_center/current
--pid-file=/home/ahn/call_center/shared/pids/adhearsion.pid

stop:
#!/usr/bin/env ruby
pid_file = '/home/ahn/call_center/shared/pids/adhearsion.pid'
if File.exist?(pid_file)
system "kill `cat #{pid_file}`"
end


Not perfect, but works for me atm.

-Jan Kubr

Reply all
Reply to author
Forward
0 new messages