2013-10-14 12:09:29 -04:00
|
|
|
production:
|
|
|
|
first_thing:
|
|
|
|
# 1. Permissions on postgres box
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/permissions.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/permissions.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
after_postgresql:
|
|
|
|
# 2. Copy SQL image to PSQL server
|
|
|
|
- source: /pg_dumps/production-image.sql
|
|
|
|
destination: /tmp/images/production-image.sql
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
owner: postgres
|
|
|
|
after_checkout:
|
|
|
|
# 3. Copy Procfile
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/Procfile
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
# 5. Copy production.rb file
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/production.rb
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/environments/production.rb
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
# 6. Move thin config to server
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/thin.yml
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/thin.yml
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
after_rails:
|
|
|
|
# 7. Set environment variables and allow PSQL user to access them
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/env_vars.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/env_vars.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
last_thing:
|
|
|
|
# 8. KILL DB
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/kill_db.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/kill_db.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 9. DB:DROP & DB:CREATE
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/drop_create.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/drop_create.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 10. Import database image
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/import_prod.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/import_prod.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
owner: postgres
|
|
|
|
run_as: postgres
|
|
|
|
# 11. Migrate database
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/migrate.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/migrate.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 12. Curl script
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/curl.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/curl.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
staging:
|
|
|
|
first_thing:
|
|
|
|
# 1. Permissions on postgres box
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/permissions.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/permissions.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
after_postgresql:
|
|
|
|
# 2. Copy SQL image to PSQL server
|
|
|
|
- source: /pg_dumps/production-image.sql
|
|
|
|
destination: /tmp/images/production-image.sql
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
owner: postgres
|
|
|
|
after_checkout:
|
|
|
|
# 3. Copy Procfile
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/Procfile
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
# 5. Rename production.rb.sample file
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/production.rb
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/environments/production.rb
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
# 6. Move thin config to server
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/thin.yml
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/thin.yml
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
after_rails:
|
|
|
|
# 7. Set environment variables and allow PSQL user to access them
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/env_vars.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/env_vars.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
last_thing:
|
|
|
|
# 8. KILL DB
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/kill_db.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/kill_db.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 9. DB:DROP & DB:CREATE
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/drop_create.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/drop_create.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 10. Import database image
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/import_prod.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/import_prod.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
owner: postgres
|
|
|
|
run_as: postgres
|
|
|
|
# 11. Migrate database
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/migrate.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/migrate.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 12. Curl script
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/curl.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/curl.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
development:
|
|
|
|
first_thing:
|
|
|
|
# 1. Permissions on postgres box
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/permissions.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
after_postgresql:
|
|
|
|
# 2. Copy SQL image to PSQL server
|
|
|
|
- source: /pg_dumps/development-image.sql
|
|
|
|
destination: /tmp/images/development-image.sql
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
owner: postgres
|
|
|
|
after_checkout:
|
|
|
|
# 3. Copy Procfile
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/Procfile
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
# 5. Move thin config to server
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/files/thin.yml
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/thin.yml
|
|
|
|
target: rails
|
2013-10-24 11:30:44 -04:00
|
|
|
run_on: all_servers
|
2013-10-14 12:09:29 -04:00
|
|
|
after_rails:
|
|
|
|
# 6. Set environment variables and allow PSQL user to access them
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/env_vars.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/env_vars.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
last_thing:
|
|
|
|
# 7. KILL DB
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/kill_db.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/kill_db.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 8. DB:DROP & DB:CREATE
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/drop_create.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/drop_create.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 9. Import database image
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/import_dev.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/scripts/import_dev.sh
|
|
|
|
target: postgresql
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
owner: postgres
|
|
|
|
run_as: postgres
|
|
|
|
# 10. Migrate database
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/migrate.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/migrate.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
|
|
|
sudo: true
|
|
|
|
# 11. Curl script
|
2013-10-24 11:30:44 -04:00
|
|
|
- source: /config/cloud/cloud66/scripts/curl.sh
|
2013-10-14 12:09:29 -04:00
|
|
|
destination: /tmp/curl.sh
|
|
|
|
target: rails
|
|
|
|
apply_during: build_only
|
|
|
|
execute: true
|
2015-06-25 02:51:48 -04:00
|
|
|
sudo: true
|