TCIE Enterprise Completley Blocked (Can't Push) Travis CI: Run after_success on a specific branch

I would like to know how to run an after_success script only for a specific branch.


after_success:
  - # some deployment script
  on: prod

#2

branches:
  only:
    - prod
    after_success:
      - # some deployment script
#3

after_success:
  branches:
    only:
      - prod
  - # some deployment script

Any suggestions? @montana any ideas?

Hi @howtotalktogirls,

Try using this script in your TRAVIS_BRANCH environment variable, make sure you execute this after_success:

after_success:
- ./deploy.sh

Here’s the bash script:

#!/bin/bash
if [ "$TRAVIS_BRANCH" == "prod" ]; then
  fi
1 Like

Thank you so much @montana, our whole team has been stalled for an hour and a half. This worked perfectly!