Skip to content

Instantly share code, notes, and snippets.

@b1ackmartian
Last active December 6, 2017 14:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save b1ackmartian/1eebc64e8904aa5655e1766cb1c41aca to your computer and use it in GitHub Desktop.
Save b1ackmartian/1eebc64e8904aa5655e1766cb1c41aca to your computer and use it in GitHub Desktop.
Travis CI Gigalixir Deploy
language: elixir
elixir: 1.5.2
otp_release: '19.0'
script:
- mix test && ./deploy.sh
#!/usr/bin/env bash
git remote add gigalixir https://$GIGALIXIR_EMAIL:$GIGALIXIR_API_KEY@git.gigalixir.com/$GIGALIXIR_APP_NAME.git
BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR"
echo "------------------------------------"
echo "BRANCH=$BRANCH"
if [ "$BRANCH" == "master" ]; then
echo "Pushing HEAD to master branch on Gigalixir."
git push gigalixir HEAD:master --verbose
echo "Deploy completed."
fi
echo "Exiting."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment