Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

Commit

Permalink
Setup automated deploys
Browse files Browse the repository at this point in the history
This commit sets up automated deploys using Travis.

The inspiration for many of these changes came from the [Micropurchase app's config](https://github.com/18F/micropurchase/blob/develop/.travis.yml).

To enable automated deploys, this commit does the following:

- Add a deploy script that takes an environment as an argument and deploys to the appropriate app on cloud.gov
- Modify the Travis configuration to add the keys that travis needs to deploy to cloud.gov

closes #204
  • Loading branch information
jmhooper committed Sep 19, 2016
1 parent 1d98fe1 commit c413795
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@ before_script:
bundler_args: "--deployment --jobs=3 --retry=3 --without development"
cache: bundler
env:
- DB=postgresql
global:
- DB=postgresql
- CF_USERNAME=18f-dolores-deployer
- secure: AJwrGkiXOnUIXORLLnFITHAPK4djtY0dvQRYRTlmSJD8hq3/AUMhmhhFRVlSB5cje7Mp4Sm9ChiUBoB029tj1nSGZZGCAEoVdlv1/wwHMAlS3Cou/O+AhxQTEg75wFNxNJArYPyqjXQxETRLKBv19z28EUADEZ+x3EHb4KNvnD5PL/tXn4snFh090w0BYbzkx1vHBURajuxeSPYT46kz+gZeU/ogZ9Ur3sFzHJjDJkS0EgicYIm13GrLokXv7mDbZa26OKRc5Sh0X19xHuPMl5USmXXNF+avQaaf0bEq84GIwjiYdGPfQP2MF/MX8U5FSxjWCOLYQGY/qZSgzj4jjEhxXtzCA55hPRinIh/PyJnQ8qeTB5FhJNU9JhTnGB9EaWDpfF1q23oQ6SeHRgUiqUJU3Vqxamlcdg7kuwh8syabgGflb8kpmQLUPC3AsyOMM0OG9ZxrbxgLf3SEg6x+fDQI8EOfg8cKNSGpu6FZIzVgVvCurG7CnrjnH8fDht+3GVx7J0F48/pXujcfgQcQ+L3eOF6NywmeNr8qccYcthbHKS3g8fUPVfHqpUlFpw/tQfEjdlFUktbSeuqW09xXsuOEbsZVQktVS9wwYYBbVVosbcKPDF5yAk7R9YuhnlZ0LLlJ5etDAHnI8HAMmhAQy27LnmJNTRkcbg0wj86ESZg=
language: ruby
rvm:
- ruby-2.3.1
sudo: false
script:
- bundle exec rake
deploy:
- provider: script
script: "./bin/deploy.sh staging"
skip_cleanup: true
on:
branch: develop
- provider: script
script: "./bin/deploy.sh production"
skip_cleanup: true
on:
branch: master
18 changes: 18 additions & 0 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set -e

API="https://api.cloud.gov"
ORG="18f"
SPACE="dolores"
ENVIRONMENT=$1

if [ $ENVIRONMENT = 'production' ]; then
NAME="dolores-app"
elif [ $ENVIRONMENT = 'staging' ]; then
NAME="dolores-staging"
else
echo "Unknown environment: $ENVIRONMENT"
exit
fi

cf login --a $API --u $CF_USERNAME --p $CF_PASSWORD --o $ORG -s $SPACE
cf push $NAME

0 comments on commit c413795

Please sign in to comment.