Skip to content

Commit

Permalink
add the deployment recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
atmos committed Jul 7, 2009
1 parent ced0173 commit c82dbe6
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Capfile
@@ -0,0 +1,3 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
75 changes: 75 additions & 0 deletions config/deploy.rb
@@ -0,0 +1,75 @@
# Please install the Engine Yard Capistrano gem
# gem install eycap --source http://gems.engineyard.com
require "eycap/recipes"

set :keep_releases, 5
set :application, 'townhall'
set :repository, 'git@github.com:atmos/thetownhall.git'
set :deploy_to, "/data/#{application}"
set :deploy_via, :export
set :monit_group, "#{application}"
set :scm, :git
set :git_enable_submodules, 1
# This is the same database name for all environments
set :production_database,'townhall_production'

set :environment_host, 'localhost'
set :deploy_via, :remote_cache

# uncomment the following to have a database backup done before every migration
# before "deploy:migrate", "db:dump"

# comment out if it gives you trouble. newest net/ssh needs this set.
ssh_options[:paranoid] = false
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
default_run_options[:pty] = true # required for svn+ssh:// andf git:// sometimes

# This will execute the Git revision parsing on the *remote* server rather than locally
set :real_revision, lambda { source.query_revision(revision) { |cmd| capture(cmd) } }


task :compton do
role :web, '174.129.222.179'
role :app, '174.129.222.179'
role :db, '174.129.222.179', :primary => true
set :environment_database, Proc.new { production_database }
set :dbuser, 'atmos'
set :dbpass, '1Rsbe46p7J'
set :user, 'atmos'
set :password, '1Rsbe46p7J'
set :runner, 'atmos'
set :rails_env, 'production'
end


# TASKS
# Don't change unless you know what you are doing!

after "deploy", "deploy:cleanup"
after "deploy:migrations", "deploy:cleanup"
after "deploy:update_code","deploy:symlink_configs"

namespace :nginx do
task :start, :roles => :app do
sudo "nohup /etc/init.d/nginx start > /dev/null"
end

task :restart, :roles => :app do
sudo "nohup /etc/init.d/nginx restart > /dev/null"
end
end

namespace :deploy do
task :start, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end

task :stop, :roles => :app do
# Do nothing.
end

task :restart, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
end

0 comments on commit c82dbe6

Please sign in to comment.