Hey @TheDFury, seems as if I answered this on GitHub as well but just in case you don’t check one or the other.
You should use the
test command in the
after_success section of your build instruction file. So your
.travis.yml file would look like this:
- test $TRAVIS_BRANCH = "master" &&
Alternatively you can deploy using a bash script in
after_success and the script will check the branch using Travis environment variables:
if [[ "$TRAVIS_BRANCH" != "master" ]]; then
echo "We're not on the master branch."
# This will analyze the current branch TheDFury and react accordingly
Add the script somewhere in the build instruction, like so:
Then you’ll be on your way to a successful deployment, and just like in any *nix distro, don’t forget to change permissions via
chmod u+x so it’s read and writable. If you run into further problems try reading the the official Travis Documentation about environment variables.
Please stop back by if you have any issues whatsoever, myself or another talented member of the Travis CI staff will get back to you.
-Montana (Travis CI Staff)