tag and push datestamped images too

This commit is contained in:
Jeffrey Paul 2019-01-24 06:50:47 +00:00
parent 9356861cf9
commit 1c0d9edca1
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,8 @@ build-master:
script: script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" . - docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE" - docker push "$CI_REGISTRY_IMAGE"
- docker tag "$CI_REGISTRY_IMAGE" "$CI_REGISTRY_IMAGE:v$(date -u +%Y%m%d)"
- docker push "$CI_REGISTRY_IMAGE:v$(date -u +%Y%m%d)"
only: only:
- master - master
@ -21,6 +23,8 @@ build:
script: script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-v$(date -u +%Y%m%d)"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-v$(date -u +%Y%m%d)"
except: except:
- master - master