Use short commit hashes in Docker image tags
This commit is contained in:
parent
45024d3dc6
commit
854810c242
|
@ -33,13 +33,14 @@ artifact-docker:
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
variables:
|
variables:
|
||||||
IMG_FILE: "send:git-$CI_COMMIT_SHA.tar"
|
IMG_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar"
|
||||||
IMG_NAME: "send:git-$CI_COMMIT_SHA"
|
IMG_NAME: "send:git-$CI_COMMIT_SHORT_SHA"
|
||||||
before_script: []
|
before_script: []
|
||||||
script:
|
script:
|
||||||
- docker build -t $IMG_NAME .
|
- docker build -t $IMG_NAME .
|
||||||
- docker image save -o $IMG_FILE $IMG_NAME
|
- docker image save -o $IMG_FILE $IMG_NAME
|
||||||
artifacts:
|
artifacts:
|
||||||
|
name: artifact-docker
|
||||||
paths:
|
paths:
|
||||||
- $IMG_FILE
|
- $IMG_FILE
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
@ -55,9 +56,9 @@ release-docker-master:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
variables:
|
variables:
|
||||||
IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHA.tar"
|
IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar"
|
||||||
IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHA"
|
IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHORT_SHA"
|
||||||
IMG_NAME: "registry.gitlab.com/timvisee/send:master-$CI_COMMIT_SHA"
|
IMG_NAME: "registry.gitlab.com/timvisee/send:master-$CI_COMMIT_SHORT_SHA"
|
||||||
before_script: []
|
before_script: []
|
||||||
script:
|
script:
|
||||||
# Login in to registry
|
# Login in to registry
|
||||||
|
@ -83,8 +84,8 @@ release-docker:
|
||||||
only:
|
only:
|
||||||
- /^v(\d+\.)*\d+$/
|
- /^v(\d+\.)*\d+$/
|
||||||
variables:
|
variables:
|
||||||
IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHA.tar"
|
IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar"
|
||||||
IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHA"
|
IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHORT_SHA"
|
||||||
IMG_NAME: "registry.gitlab.com/timvisee/send:$CI_COMMIT_REF_NAME"
|
IMG_NAME: "registry.gitlab.com/timvisee/send:$CI_COMMIT_REF_NAME"
|
||||||
IMG_NAME_LATEST: "registry.gitlab.com/timvisee/send:latest"
|
IMG_NAME_LATEST: "registry.gitlab.com/timvisee/send:latest"
|
||||||
before_script: []
|
before_script: []
|
||||||
|
|
Loading…
Reference in New Issue