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

Relying on $TRAVIS_BRANCH is causing us to overwrite *:latest containers in Docker Hub #31

Closed
breerly opened this Issue Mar 1, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@breerly
Copy link
Contributor

breerly commented Mar 1, 2016

Turns out the $TRAVIS_BRANCH environment variable acts in a bit of a surprising way:

For builds not triggered by a pull request this is the name of the branch currently being built; whereas for builds triggered by a pull request this is the name of the branch targeted by the pull request (in many cases this will be master).

To be specific, this means that the value of $TRAVIS_BRANCH looks like this:

continuous-integration/travis-ci/push - $TRAVIS_BRANCH=<current branch name>  
continuous-integration/travis-ci/pr - $TRAVIS_BRANCH=master  

Since our after_success target uses $TRAVIS_BRANCH to tag our Docker Container and then pushes it to Docker Hub, it means that EVERY PR is overwriting the latest tag in Docker Hub.

This means that any breaking changes in a PR will overwrite master, causing every repo's test to fail.

@breerly breerly closed this in #32 Mar 2, 2016

@breerly breerly changed the title v2 branch is overwriting crossdock:latest container Relying on $TRAVIS_BRANCH is causing us to overwrite *:latest containers in Docker Hub Mar 3, 2016

@breerly

This comment has been minimized.

@breerly

This comment has been minimized.

Copy link
Contributor

breerly commented Mar 3, 2016

Looks like these guys could use this - diagrams/diagrams-travis#1 (comment)

ajmazurie added a commit to starlingtrust/docker-probe that referenced this issue Dec 10, 2017

ajmazurie added a commit to starlingtrust/docker-probe that referenced this issue Dec 10, 2017

ajmazurie added a commit to starlingtrust/docker-probe that referenced this issue Dec 10, 2017

inhumantsar pushed a commit to inhumantsar/docker-ansible that referenced this issue Jul 25, 2018

inhumantsar added a commit to inhumantsar/docker-ansible that referenced this issue Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment