Docker tag/push fix.

This commit is contained in:
Pete Johanson 2020-05-11 11:46:49 -04:00
parent 858abaf0d4
commit 9137bf1ce5

View file

@ -38,5 +38,5 @@ build:dockerimage:
- docker pull $CI_BUILD_IMAGE:latest || true - docker pull $CI_BUILD_IMAGE:latest || true
- docker build --cache-from $CI_BUILD_IMAGE:latest -t $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA . - docker build --cache-from $CI_BUILD_IMAGE:latest -t $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA .
- docker push $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA - docker push $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA
- docker tag $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA $CI_BUILD_IMAGE:latest && git push $CI_BUILD_IMAGE:latest - docker tag $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA $CI_BUILD_IMAGE:latest && docker push $CI_BUILD_IMAGE:latest
- if [ -n "$CI_COMMIT_TAG" ]; then docker tag $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA $CI_BUILD_IMAGE:$CI_COMMIT_TAG && docker push $CI_BUILD_IMAGE:$CI_COMMIT_TAG; fi - if [ -n "$CI_COMMIT_TAG" ]; then docker tag $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA $CI_BUILD_IMAGE:$CI_COMMIT_TAG && docker push $CI_BUILD_IMAGE:$CI_COMMIT_TAG; fi