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