Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow branch specific whitelisting and blacklisting for after_success #5065

Closed
gravyboat opened this issue Nov 8, 2015 · 3 comments
Closed

Comments

@gravyboat
Copy link

It would be great if I could have whitelisting and blacklisting for after_success like this:

after_success:
  branches:
    only:
      - master
      - test
      - dev
  - docker login .....
  - docker push blah/blah

The use case is for when someone makes a PR with their branch I don't want to do a docker push until AFTER the merge is approved when the second Travis build occurs onto the main branch.

@gravyboat gravyboat changed the title Allow branch specific whitelisting and blacklisting to after_success Allow branch specific whitelisting and blacklisting for after_success Nov 8, 2015
@BanzaiMan
Copy link
Contributor

You can use $TRAVIS_BRANCH to achieve what you are after. Unlike deployments and notifications, after_success section is compiled into the build script, so that adding this kind of conditional is a bit more involved.

@gravyboat
Copy link
Author

@BanzaiMan Thanks for the comment, I'm actually doing that currently:

    - if [ "$TRAVIS_BRANCH" == "master" ]; then
        docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
        docker push forresta/docka-docka-docka;
      fi

If it's a hassle to add it might be more relevant to just add this kind of note to the after_success docs.

@gravyboat
Copy link
Author

I'm going to close this since my work around is good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants