I would like to know how to run an after_success script only for a specific branch.
after_success
I am using a custom script to deploy the app after build passes. I would
I solved it by writing a simple script using TRAVIS_BRANCH environment variable and executed the script in after_success
TRAVIS_BRANCH
.travis.yml
after_success: - ./deploy.sh
deploy.sh
#!/bin/bash if [ "$TRAVIS_BRANCH" == "prod" ]; then // do the deploy fi