summaryrefslogtreecommitdiff
path: root/config/dd.deploy.txt
diff options
context:
space:
mode:
Diffstat (limited to 'config/dd.deploy.txt')
-rw-r--r--config/dd.deploy.txt114
1 files changed, 0 insertions, 114 deletions
diff --git a/config/dd.deploy.txt b/config/dd.deploy.txt
deleted file mode 100644
index bd34f26..0000000
--- a/config/dd.deploy.txt
+++ /dev/null
@@ -1,114 +0,0 @@
-require 'bundler/capistrano'
-
-set :application, "dd-new"
-set :repository, "file://."
-set :scm, :git
-set :deploy_strategy, :copy
-
-set :stages, %w(production qa)
-set :default_stage, "production"
-
-require 'capistrano/ext/multistage'
-
-set :user, "cap"
-set :group, "wheel"
-set :use_sudo, false
-set :keep_releases, 3
-
-set :deploy_to, "/srv/apps/#{application}"
-set :deploy_via, :remote_cache
-
-set :whenever_command, "bundle exec whenever"
-set :whenever_environment, defer { stage }
-set :artifact_name, 'dd.tgz'
-set :artifacts_path, File.join(File.dirname(__FILE__), '..', 'artifacts', artifact_name)
-require File.join(File.dirname(__FILE__), 'deploy', 'whenever')
-
-ssh_options[:keys] = "#{ENV['HUDSON_HOME']}/.ssh/id_rsa"
-puts "SSH Key found in: #{ssh_options[:keys]}"
-
-namespace :deploy do
-
- task :update_code do
- puts "uploading #{artifacts_path}"
- run "mkdir -p #{release_path}"
- top.upload artifacts_path, "#{release_path}/#{artifact_name}"
- run "cd #{release_path} && tar -xzvf #{artifact_name}"
- run "mv #{release_path}/dd/* #{release_path}/"
- end
-
- task :symlink_shared do
- run "mkdir -p #{release_path}/tmp && ln -s #{deploy_to}/shared/pids #{release_path}/tmp/pids"
- run "rm -rf #{release_path}/log && ln -s #{deploy_to}/shared/log #{release_path}/log"
- end
-
- task :migrate, :roles => [:db] do
- run "cd #{release_path} && RAILS_ENV=#{stage} bundle exec rake db:migrate db:mongoid:create_indexes"
- end
-
- task :restart do
- restart_passenger
- restart_poller
- restart_twitter_streamer
- end
-
- task :restart_passenger, roles: [:app] do
- run "touch #{release_path}/tmp/restart.txt"
- end
-
- task :restart_poller, roles: [:poller] do
- run "chmod a+x #{release_path}/script/poller"
- run "cd #{release_path} && RAILS_ENV=#{stage} bundle exec script/poller restart"
- end
-
- task :restart_twitter_streamer, roles: [:poller] do
- run "chmod a+x #{release_path}/script/twitter_streamer"
- run "cd #{release_path} && RAILS_ENV=#{stage} bundle exec script/twitter_streamer restart"
- end
-
-end
-
-namespace :monit do
-
- task :change_permission do
- run "chmod 0700 #{release_path}/config/*.monitrc"
- end
-
- task :start_web, roles: [:web] do
- run "cd #{release_path}/config && monit -d 10 -c web.monitrc"
- end
-
- task :stop_web, roles: [:web] do
- run "cd #{release_path}/config && monit quit -c web.monitrc"
- end
-
- task :start_db, roles: [:db] do
- run "cd #{release_path}/config && monit -d 10 -c db_poller.monitrc"
- end
-
- task :stop_db, roles: [:db] do
- run "cd #{release_path}/config && monit quit -c db_poller.monitrc"
- end
-
- task :stop do
- change_permission
- stop_web
- stop_db
- end
-
- task :start do
- start_web
- start_db
- end
-end
-
-task :uname do
- run "uname -a"
-end
-
-after 'deploy:update_code', 'monit:stop'
-after 'deploy:update_code', 'deploy:symlink_shared'
-after 'deploy:symlink_shared', 'bundle:install'
-after 'bundle:install', 'deploy:migrate'
-after 'deploy', 'deploy:cleanup'
-after 'deploy:cleanup', 'monit:start'