Skip to content

Commit

Permalink
CI - always build docker image, publish it only for a git tag
Browse files Browse the repository at this point in the history
Seconds release with docker build error - 6ef3519

https://travis-ci.org/EdgedesignCZ/phpqa/jobs/558464512#L2025
  Problem 1
    - Conclusion: don't install sensiolabs/security-checker v6.0.1
    - Conclusion: remove symfony/polyfill-mbstring v1.1.1

https://docs.travis-ci.com/user/deployment/#conditional-releases-with-on
Skipping a deployment with the script provider because this branch is not permitted: fix-docker-build-20190714
https://travis-ci.org/EdgedesignCZ/phpqa/jobs/558468152#L1639
  • Loading branch information
zdenekdrahos committed Jul 14, 2019
1 parent 1fe23e7 commit 8d80794
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .docker/build-image
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ load_docker_variables () {

build_docker_image () {
set -e
docker login --username $DOCKER_USER --password $DOCKER_TOKEN
time docker build --file $DOCKER_FILE --tag $DOCKER_TAG $APP_DIR

if [ -z "$TRAVIS_TAG" ]; then
echo "Docker image is published only if the current build is for a git tag"
exit 0
fi
docker login --username $DOCKER_USER --password $DOCKER_TOKEN
time docker push $DOCKER_TAG
}

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ deploy:
script: .docker/build-image
skip_cleanup: true
on:
tags: true
all_branches: true
php: 7.0
# http://blog.wyrihaximus.net/2015/07/composer-cache-on-travis/
cache:
Expand Down

0 comments on commit 8d80794

Please sign in to comment.