We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This issue comes in two steps. Firstly, it is important to change the current travis setup to a build-matrix, e.g. add
env: - IMAGE=cvmfs-base BUILD=build UPLOAD=upload - IMAGE=cvmfs-base-cc7 BUILD=build-cc7 UPLOAD=upload-cc7 - ... script: - cd $IMAGE - make $BUILD
This allows fine-grained testing on a per-image basis.
The second part is to define what will happen after a successful build:
after_success: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - cd $IMAGE - make $UPLOAD
The mentioned docker details for https://hub.docker.com/u/hepsw/ need to be added in an encrypted form as shown in https://sebest.github.io/post/using-travis-ci-to-build-docker-images/. The downside is that the upload will not work for PRs from forks but only for tagged or master builds (i.e. after the merge).
Travis also recommends to create two sets of scripts as secrets won't be available to PRs from forks:
after_success: - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./travis/run_on_pull_requests; fi' - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./travis/run_on_non_pull_requests; fi'
This means all the above would come together as
sudo: required services: - docker env: global: - secure: "UkF2CHX0lUZ...VI/LE=" # DOCKER_EMAIL - secure: "Z3fdBNPt5hR...VI/LE=" # DOCKER_USER - secure: "F4XbD6WybHC...VI/LE=" # DOCKER_PASS matrix: - IMAGE=cvmfs-base BUILD=build UPLOAD=upload - IMAGE=cvmfs-base-cc7 BUILD=build-cc7 UPLOAD=upload-cc7 - ... script: - cd $IMAGE - make $BUILD after_success: - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./travis/no_upload; fi' - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./travis/upload_stuff; fi'
with ./travis/no_upload
./travis/no_upload
#!/usr/bin/env bash echo "No upload"
and ./travis/upload_stuff
./travis/upload_stuff
#!/usr/bin/env bash echo "Pushing $IMAGE to docker hub" docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS cd $IMAGE make $UPLOAD
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This issue comes in two steps.
Firstly, it is important to change the current travis setup to a build-matrix, e.g. add
This allows fine-grained testing on a per-image basis.
The second part is to define what will happen after a successful build:
The mentioned docker details for https://hub.docker.com/u/hepsw/ need to be added in an encrypted form as shown in https://sebest.github.io/post/using-travis-ci-to-build-docker-images/.
The downside is that the upload will not work for PRs from forks but only for tagged or master builds (i.e. after the merge).
Travis also recommends to create two sets of scripts as secrets won't be available to PRs from forks:
This means all the above would come together as
with
./travis/no_upload
and
./travis/upload_stuff
The text was updated successfully, but these errors were encountered: