Skip to content
Browse files

production moved to ec2

  • Loading branch information...
1 parent c3297e9 commit 5bed4ff8f8c431bdcf23c834617ef88ad547f78c @decioferreira decioferreira committed May 8, 2012
Showing with 36 additions and 47 deletions.
  1. +0 −43 config/deploy/background-staging.rb
  2. +36 −4 config/deploy/production.rb
View
43 config/deploy/background-staging.rb
@@ -1,43 +0,0 @@
-set :default_environment, {
- 'PATH' => "/usr/local/rvm/gems/ruby-1.9.2-p318/bin:/usr/local/rvm/bin:/usr/local/rvm/rubies/ruby-1.9.2-p318/bin:$PATH",
- 'RUBY_VERSION' => 'ruby-1.9.2-p318',
- 'GEM_HOME' => '/usr/local/rvm/gems/ruby-1.9.2-p318',
- 'GEM_PATH' => '/usr/local/rvm/gems/ruby-1.9.2-p318',
-}
-
-set :rails_env, "staging"
-
-# Primary domain name of your application. Used in the Apache configs
-set :domain, 'ec2-107-22-142-254.compute-1.amazonaws.com'
-set :branch, :generate_layer_files
-set :application, "validation-background-staging"
-## List of servers
-server 'ec2-107-22-142-254.compute-1.amazonaws.com', :app, :web, :db, :primary => true, :jobs => true
-
-after "deploy:symlink", "deploy:restart_workers"
-after "deploy:restart_workers", "deploy:restart_scheduler"
-
-##
-# Rake helper task.
-# http://pastie.org/255489
-# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
-# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
-def run_remote_rake(rake_cmd)
- rake_args = ENV['RAKE_ARGS'].to_s.split(',')
- cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"
- cmd += "['#{rake_args.join("','")}']" unless rake_args.empty?
- run cmd
- set :rakefile, nil if exists?(:rakefile)
-end
-
-namespace :deploy do
- desc "Restart Resque Workers"
- task :restart_workers, :roles => :db, :only => { :jobs => true } do
- run_remote_rake "resque:restart_workers"
- end
-
- desc "Restart Resque scheduler"
- task :restart_scheduler, :roles => :db, :only => { :jobs => true } do
- run_remote_rake "resque:restart_scheduler"
- end
-end
View
40 config/deploy/production.rb
@@ -1,5 +1,37 @@
-# Primary domain name of your application. Used in the Apache configs
-set :domain, "unepwcmc-004.vm.brightbox.net"
+set :default_environment, {
+ 'PATH' => "/usr/local/rvm/gems/ruby-1.9.2-p318/bin:/usr/local/rvm/bin:/usr/local/rvm/rubies/ruby-1.9.2-p318/bin:$PATH",
+ 'RUBY_VERSION' => 'ruby-1.9.2-p318',
+ 'GEM_HOME' => '/usr/local/rvm/gems/ruby-1.9.2-p318',
+ 'GEM_PATH' => '/usr/local/rvm/gems/ruby-1.9.2-p318',
+}
-## List of servers
-server "unepwcmc-004.vm.brightbox.net", :app, :web, :db, :primary => true
+set :domain, 'ec2-107-22-142-254.compute-1.amazonaws.com'
+server 'ec2-107-22-142-254.compute-1.amazonaws.com', :app, :web, :db, :primary => true, :jobs => true
+
+after "deploy:symlink", "deploy:restart_workers"
+after "deploy:restart_workers", "deploy:restart_scheduler"
+
+##
+# Rake helper task.
+# http://pastie.org/255489
+# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
+# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
+def run_remote_rake(rake_cmd)
+ rake_args = ENV['RAKE_ARGS'].to_s.split(',')
+ cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"
+ cmd += "['#{rake_args.join("','")}']" unless rake_args.empty?
+ run cmd
+ set :rakefile, nil if exists?(:rakefile)
+end
+
+namespace :deploy do
+ desc "Restart Resque Workers"
+ task :restart_workers, :roles => :db, :only => { :jobs => true } do
+ run_remote_rake "resque:restart_workers"
+ end
+
+ desc "Restart Resque scheduler"
+ task :restart_scheduler, :roles => :db, :only => { :jobs => true } do
+ run_remote_rake "resque:restart_scheduler"
+ end
+end

0 comments on commit 5bed4ff

Please sign in to comment.
Something went wrong with that request. Please try again.