Created
April 9, 2014 06:07
-
-
Save halsk/10230544 to your computer and use it in GitHub Desktop.
LocomotiveCMS で、複数の Heroku インスタンスを使う ref: http://qiita.com/hal_sk/items/aba8d324638d205b2ce1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(中略) | |
when :staging | |
# the following configuration works for Amazon S3 | |
config.storage = :fog | |
config.fog_credentials = { | |
provider: 'AWS', | |
aws_access_key_id: ENV['S3_KEY_ID'], | |
aws_secret_access_key: ENV['S3_SECRET_KEY'], | |
region: ENV['S3_BUCKET_REGION'] | |
} | |
config.fog_directory = ENV['S3_BUCKET'] | |
when :production | |
# the following configuration works for Amazon S3 | |
config.storage = :fog | |
config.fog_credentials = { | |
provider: 'AWS', | |
aws_access_key_id: ENV['S3_KEY_ID'], | |
aws_secret_access_key: ENV['S3_SECRET_KEY'], | |
region: ENV['S3_BUCKET_REGION'] | |
} | |
config.fog_directory = ENV['S3_BUCKET'] | |
.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote rename heroku staging | |
git remote add production [email protected]:fivejcup.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku addons:add mongohq --remote production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku addons:add sendgrid:starter --remote production | |
cp config/environments/production.rb config/environments/staging.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku config:set RACK_ENV=staging --app staging_app_name #旧環境の設定をstagingに変更 | |
heroku config:set RAILS_ENV=staging --app staging_app_name #旧環境の設定をstagingに変更 | |
heroku config:add BUNDLE_WITHOUT=development:test --app production_app_name #新環境の設定を追加 | |
heroku config:add HEROKU_API_KEY=<YOUR HEROKU API KEY> --app production_app_name #新環境の設定を追加 | |
heroku config:add HEROKU_APP_NAME=<YOUR APP NAME> --app production_app_name #新環境の設定を追加 | |
heroku config:add S3_KEY_ID=<YOUR S3 KEY ID> --app production_app_name #新環境の設定を追加 | |
heroku config:add S3_SECRET_KEY=<YOUR S3 SECRET KEY> --app production_app_name #新環境の設定を追加 | |
heroku config:add S3_BUCKET=<YOUR S3 BUCKET NAME> --app production_app_name #新環境の設定を追加 | |
heroku config:add S3_BUCKET_REGION=<YOUR S3 BUCKET REGION> --app production_app_name #新環境の設定を追加 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push staging master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push production master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(省略) | |
staging: | |
sessions: | |
default: | |
uri: <%= ENV['MONGOHQ_URL'] %> | |
production: | |
sessions: | |
default: | |
uri: <%= ENV['MONGOHQ_URL'] %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment