Skip to content

Commit

Permalink
always update staging db
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Westby committed May 25, 2018
1 parent 14000b3 commit 39a9cf4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ install: scripts/ci/install.sh
script: scripts/ci/test.sh
deploy:
provider: script
script: scripts/ci/deploy.sh --branch $TRAVIS_BRANCH --commit_hash $TRAVIS_COMMIT --now_token $NOW_TOKEN --release_hook $SENTRY_WEBHOOK
script: scripts/ci/deploy.sh --branch $TRAVIS_BRANCH --commit_hash $TRAVIS_COMMIT --now_token $NOW_TOKEN --release_hook $SENTRY_WEBHOOK --heroku_token $HEROKU_TOKEN
on:
all_branches: true
addons:
apt:
sources:
- heroku
packages:
- heroku-toolbelt
7 changes: 5 additions & 2 deletions scripts/ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,15 @@ if [[ $branch_name == "master" ]]; then

now -t $now_token -A ./now.json alias

rm ./now.json

curl $release_hook \
-X POST \
-H 'Content-Type: application/json' \
-d '{"version": "'"$commit_hash"'"}'

rm ./now.json

# remove deployments that are more than 2 behind
now -t $now_token ls --all ellie-production | grep DOCKER | awk '{ print $2 }' | tail -n +3 | xargs now rm --yes
else
app_name=ellie-test-$branch_name
echo '{ "name": "'"$app_name"'", "alias": "'"$app_name"'.now.sh" }' > ./now.json
Expand Down

0 comments on commit 39a9cf4

Please sign in to comment.