Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Mark Cornick http://mcornick.org/

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Capistrano for TXD Containers

A mostly-standardized Capistrano deploy.rb file for the TXD containers. Adjust :application, :smf, :repository, :deploy_to as required; adjust the role definitions too if you want to use different hosts.

Copy your database.yml file to /home/example/rails/example.org/shared/config/database.yml and it'll get symlinked into place before the app is restarted.

This works with my SMF manifest here

set :application, "example.org"
set :smf, "mongrel/example"
set :repository, "https://example.textdriven.com/svn/#{application}"
set :deploy_to, "/home/example/rails/#{application}"
role :web, "#{application}", :primary => true
role :app, "#{application}", :primary => true
role :db, "#{application}", :primary => true

set :checkout, "export"
set :svn, "/opt/csw/bin/svn"
set :sudo, "/opt/csw/bin/sudo"
set :rake, "/opt/csw/bin/rake"

task :after_update_code do
  run "ln -s #{deploy_to}/#{shared_dir}/config/database.yml #{current_release}/config/database.yml"
  run "rm -f #{current_path}"
end

task :spinner, :roles => :app do
  send(run_method, "/usr/sbin/svcadm start #{smf}")
end

task :restart, :roles => :app do
  send(run_method, "/usr/sbin/svcadm restart #{smf}")
end
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed