testing registry
This commit is contained in:
@@ -35,7 +35,7 @@ variables:
|
|||||||
|
|
||||||
make_image:
|
make_image:
|
||||||
stage: build
|
stage: build
|
||||||
image: docker:26.1.3-dind
|
image: docker:26.1.3
|
||||||
services:
|
services:
|
||||||
- docker:26.1.3-dind
|
- docker:26.1.3-dind
|
||||||
|
|
||||||
@@ -52,14 +52,15 @@ make_image:
|
|||||||
- >
|
- >
|
||||||
DOCKER_BUILDKIT=1 docker build
|
DOCKER_BUILDKIT=1 docker build
|
||||||
--pull
|
--pull
|
||||||
|
--cache-from $CI_REGISTRY_IMAGE:latest
|
||||||
--label "org.opencontainers.image.title=$CI_PROJECT_TITLE"
|
--label "org.opencontainers.image.title=$CI_PROJECT_TITLE"
|
||||||
--label "org.opencontainers.image.url=$CI_PROJECT_URL"
|
--label "org.opencontainers.image.url=$CI_PROJECT_URL"
|
||||||
--label "org.opencontainers.image.created=$CI_JOB_STARTED_AT"
|
--label "org.opencontainers.image.created=$CI_JOB_STARTED_AT"
|
||||||
--label "org.opencontainers.image.revision=$CI_COMMIT_SHORT_SHA"
|
--label "org.opencontainers.image.revision=$CI_COMMIT_SHA"
|
||||||
--label "org.opencontainers.image.version=$CI_COMMIT_REF_NAME"
|
--label "org.opencontainers.image.version=$CI_COMMIT_REF_NAME"
|
||||||
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
|
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
.
|
.
|
||||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
|
|
||||||
# Here, the goal is to tag the "master" branch as "latest"
|
# Here, the goal is to tag the "master" branch as "latest"
|
||||||
Push latest:
|
Push latest:
|
||||||
@@ -73,7 +74,7 @@ Push latest:
|
|||||||
script:
|
script:
|
||||||
# Because we have no guarantee that this job will be picked up by the same runner
|
# Because we have no guarantee that this job will be picked up by the same runner
|
||||||
# that built the image in the previous step, we pull it again locally
|
# that built the image in the previous step, we pull it again locally
|
||||||
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
|
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
# Then we tag it "latest"
|
# Then we tag it "latest"
|
||||||
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
|
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
|
||||||
# Annnd we push it.
|
# Annnd we push it.
|
||||||
@@ -89,7 +90,7 @@ Push commit:
|
|||||||
GIT_STRATEGY: none
|
GIT_STRATEGY: none
|
||||||
stage: push
|
stage: push
|
||||||
script:
|
script:
|
||||||
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
|
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
||||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
||||||
|
|
||||||
@@ -104,6 +105,6 @@ Push tag:
|
|||||||
# We want this job to be run on tags only.
|
# We want this job to be run on tags only.
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
|
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
||||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
||||||
Reference in New Issue
Block a user