Created
June 8, 2009 12:25
-
-
Save leehambley/125785 to your computer and use it in GitHub Desktop.
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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | |
# Agent Forwarding & a real terminal | |
default_run_options[:pty] = true | |
set :ssh_options, { :forward_agent => false } | |
# Server IP | |
SERVER_ADDRESS = '192.168.3.***' | |
# Remote Dependencies | |
depend :remote, :gem, 'integrity', '=0.1.10' | |
depend :remote, :gem, 'builder', '=2.1.2' | |
depend :remote, :gem, 'do_sqlite3', '=0.9.12' | |
# Look it up by IP until we decide what to name the server! | |
role :web, SERVER_ADDRESS, :primary => true | |
# Couple of things.... | |
set :application, 'ciserver' | |
set :local_repository, 'svn+ssh://**************/scm/ciserver/trunk' | |
set :repository, 'https://****************/repos/ciserver/trunk' | |
set :deploy_to, '/var/www/************/' | |
set :deploy_via, :copy | |
set :scm_username, '************' | |
set :scm_password, '************' | |
set :apache_logs, ['/var/log/apache2/error.log', '/var/log/apache2/access.log'] | |
# set :user, Net::SSH::Config.for(SERVER_ADDRESS)[:user] | |
# Taken from the Capistrano 2.6.0 pre-release. | |
load 'config/deploy' | |
set :shared_path, "#{File.join(deploy_to, 'persistent')}" | |
set :shared_children, ['db', 'builds', 'log'] | |
before 'deploy' do | |
run "#{sudo} chmod -R a+rwx #{deploy_to}" | |
end | |
after 'deploy:symlink' do | |
run <<-EOT | |
if [ ! -f #{File.join(shared_path, 'db', 'integrity.db')} ]; then cd #{deploy_to} && integrity migrate_db #{current_path}/config.yml; fi | |
EOT | |
end | |
after 'deploy', 'deploy:restart' | |
namespace :deploy do | |
task :restart do | |
run "touch #{File.join(current_path, 'tmp', 'restart.txt')}" | |
end | |
end | |
namespace :logs do | |
task :tail do | |
stream "#{sudo} tail -f #{File.join(shared_path, 'log', '*')} #{fetch(:apache_logs).join(' ')}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment