-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I found a tip for docker push. This tip can be used for not only multiarch/fedora, but also other multiarch/*.
Right now our .travis.yml's docker push logic is like this.
after_success:
- |
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" "$DOCKER_SERVER" && \
docker push $DOCKER_REPO
fi
This logic 's challenge is
- We cat not catch an script failure in the process of
after_success. If the error happens in it, the Travis CI still succeeds.
I assume when using deploy: for docker login and docker push, we can catch an error in the deploy, also can write conditional statement like "if branch == master" simply.
https://medium.com/mobileforgood/5-tips-to-optimise-your-travis-ci-file-eced09d2d74e
3. Docker image caching
.travis.yml
before_deploy:
- echo -n "$REGISTRY_PASS" | docker login -u "$REGISTRY_USER" --password-stdin
deploy:
provider: script
script: docker push "$IMAGE_TAG"
on:
branch: master
https://docs.travis-ci.com/user/docker/#branch-based-registry-pushes
https://docs.travis-ci.com/user/deployment
lafin
Metadata
Metadata
Assignees
Labels
No labels