0
-set :stages, %w(staging production)
0
-set :default_stage, "production"
0
-<<<<<<< HEAD:config/deploy.rb
0
-require File.expand_path("#{File.dirname(__FILE__)}/../vendor/gems/capistrano-ext-1.2.1/lib/capistrano/ext/multistage")
0
#############################################################
0
#############################################################
0
-require File.expand_path("#{File.dirname(__FILE__)}/../vendor/gems/capistrano-ext-1.2.1/lib/capistrano/ext/multistage")
0
->>>>>>> fudgestudios/master:config/deploy.rb
0
+require 'capistrano/ext/multistage'
0
+set :stages, %w(staging production)
0
+set :default_stage, "production"
0
+set :application, "yummylogs"
0
-<<<<<<< HEAD:config/deploy.rb
0
#############################################################
0
#############################################################
0
default_run_options[:pty] = true
0
ssh_options[:forward_agent] = true
0
#############################################################
0
#############################################################
0
-set :gateway, 'gateway.example.com'
0
-set :domain, "www.example.com"
0
-server domain, :app, :web
0
-role :db, domain, :primary => true
0
+set :gateway, 'gate.pixels-and-bits.com'
0
+role :web, 'web.pixles-and-bits.com'
0
+role :app, 'app1.pixles-and-bits.com'
0
+role :db, 'db.pixels-and-bits', :primary => true
0
#############################################################
0
#############################################################
0
-set :scm_passphrase, "PASSWORD"
0
-set :repository, "git@github.com:FudgeStudios/bort.git"
0
+set :scm_user, 'pb-deploy'
0
+set :repository, "git@github.com:pixels-and-bits/#{application}.git"
0
+set :deploy_to, "/var/webapps/#{application}/website"
0
set :deploy_via, :remote_cache
0
-set :
repository_cache, "repo_cache"0
#############################################################
0
#############################################################
0
- desc "Create the database yaml file"
0
- task :after_update_code do
0
- deploy:write_db_config
0
- #########################################################
0
- # Uncomment the following to symlink an uploads directory.
0
- # Just change the paths to whatever you need.
0
- #########################################################
0
- # desc "Symlink the upload directories"
0
- # task :before_symlink do
0
- # run "mkdir -p #{shared_path}/uploads"
0
- # run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
0
+ desc "This to do once we get the code up"
0
+ task :after_update_code, :roles => :app, :except => { :no_release => true } do
0
+ send(run_method, "cd #{release_path} && sudo gemtools install")
0
+ #########################################################
0
+ # Uncomment the following to symlink an uploads directory.
0
+ # Just change the paths to whatever you need.
0
+ #########################################################
0
+ # desc "Symlink the upload directories"
0
+ # task :before_symlink do
0
+ # run "mkdir -p #{shared_path}/uploads"
0
+ # run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
0
# Restart passenger on deploy
0
desc "Restarting mod_rails with restart.txt"
0
task :restart, :roles => :app, :except => { :no_release => true } do
0
run "touch #{current_path}/tmp/restart.txt"
0
- desc 'Dumps the production database to db/production_data.sql on the remote server'
0
- task :remote_db_dump, :roles => :db, :only => { :primary => true } do
0
- run "cd #{deploy_to}/#{current_dir} && " +
0
- "rake RAILS_ENV=#{rails_env} db:database_dump --trace"
0
- desc 'Downloads db/production_data.sql from the remote production environment to your local machine'
0
- task :remote_db_download, :roles => :db, :only => { :primary => true } do
0
- execute_on_servers(options) do |servers|
0
- self.sessions[servers.first].sftp.connect do |tsftp|
0
- tsftp.download!("#{deploy_to}/#{current_dir}/db/production_data.sql", "db/production_data.sql")
0
->>>>>>> fudgestudios/master:config/deploy.rb
0
- desc 'Cleans up data dump file'
0
- task :remote_db_cleanup, :roles => :db, :only => { :primary => true } do
0
- execute_on_servers(options) do |servers|
0
- self.sessions[servers.first].sftp.connect do |tsftp|
0
- tsftp.remove! "#{deploy_to}/#{current_dir}/db/production_data.sql"
0
- desc 'Dumps, downloads and then cleans up the production data dump'
0
- task :remote_db_runner do
0
-<<<<<<< HEAD:config/deploy.rb
0
- desc "Prompts the deployment user for the database password, then generates config/database.yml"
0
- task :write_db_config, :roles => [:app, :db], :except => { :no_release => true } do
0
- buffer = YAML::load_file('config/database.template.yml')
0
- user = buffer[rails_env]['username']
0
- host = buffer[rails_env]['host'] || 'localhost'
0
- dbname = buffer[rails_env]['database']
0
- set :deployed_database_password, proc {
0
- Capistrano::CLI.password_prompt("
0
-DB password for #{user}@#{host}:/#{dbname} : ")
0
- buffer.keys.each { |env|
0
- buffer[env]['password'] = deployed_database_password
0
- put YAML::dump(buffer), "#{release_path}/config/database.yml", :mode => 0664
0
@@ -134,11 +69,11 @@ namespace :db do
0
desc 'Dumps the production database to db/production_data.sql on the remote server'
0
task :remote_db_dump, :roles => :db, :only => { :primary => true } do
0
run "cd #{deploy_to}/#{current_dir} && " +
0
- "rake RAILS_ENV=#{rails_env} db:database_dump --trace"
0
+ "rake RAILS_ENV=#{rails_env} db:database_dump --trace"
0
desc 'Downloads db/production_data.sql from the remote production environment to your local machine'
0
- task :remote_db_download, :roles => :db, :only => { :primary => true } do
0
+ task :remote_db_download, :roles => :db, :only => { :primary => true } do
0
execute_on_servers(options) do |servers|
0
self.sessions[servers.first].sftp.connect do |tsftp|
0
tsftp.download!("#{deploy_to}/#{current_dir}/db/production_data.sql", "db/production_data.sql")
0
@@ -150,10 +85,10 @@ namespace :db do
0
task :remote_db_cleanup, :roles => :db, :only => { :primary => true } do
0
execute_on_servers(options) do |servers|
0
self.sessions[servers.first].sftp.connect do |tsftp|
0
- tsftp.remove! "#{deploy_to}/#{current_dir}/db/production_data.sql"
0
+ tsftp.remove! "#{deploy_to}/#{current_dir}/db/production_data.sql"
0
desc 'Dumps, downloads and then cleans up the production data dump'
0
task :remote_db_runner do
0
@@ -161,6 +96,4 @@ namespace :db do
0
->>>>>>> fudgestudios/master:config/deploy.rb
0
\ No newline at end of file