-
-
Save venkatd/799f76214217a1759e65260f072543d4 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e -o pipefail | |
if [ "${TRAVIS_BRANCH}" == "master" ]; then | |
TARGET_APP_NAME="turtle-api" | |
echo "Backing up the database (if a migration is needed)" | |
heroku run "mix db.backup_before_migration" --app "${TARGET_APP_NAME}" | |
echo "Running migrations (if there are any)..." | |
heroku run "mix ecto.migrate" --app "${TARGET_APP_NAME}" | |
echo "Rebuilding subscribers (if needed)" | |
heroku run "mix es.rebuild_subscribers" --app "${TARGET_APP_NAME}" | |
echo "Setting maintenance mode 'off' on heroku's app" | |
heroku maintenance:off --app "${TARGET_APP_NAME}" | |
echo "Application ready again. YAY!" | |
fi |
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
#!/bin/bash | |
set -e -o pipefail | |
if [ "${TRAVIS_BRANCH}" == "master" ]; then | |
TARGET_APP_NAME="turtle-api" | |
echo "Setting up '~/.ssh/config' to work with heroku." | |
cat >> ~/.ssh/config <<EOF | |
Host heroku.com | |
StrictHostKeyChecking no | |
CheckHostIP no | |
UserKnownHostsFile=/dev/null | |
EOF | |
# DOC: https://devcenter.heroku.com/articles/authentication#usage-examples | |
cat >> ~/.netrc <<EOF | |
machine api.heroku.com | |
login ${HEROKU_API_LOGIN} | |
password ${HEROKU_API_KEY} | |
EOF | |
chmod 600 ~/.netrc | |
echo "Installing heroku toolbelt" | |
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh | |
echo "Setting maintenance mode 'on' on heroku's app" | |
heroku maintenance:on --app "${TARGET_APP_NAME}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment