testing registry

This commit is contained in:
2024-05-29 21:51:11 +03:00
parent 3e4f8937f3
commit 40bf30b19f

View File

@@ -31,8 +31,6 @@ variables:
# See https://github.com/docker-library/docker/pull/166
DOCKER_TLS_CERTDIR: "/certs"
make_image:
stage: build
needs:
@@ -42,7 +40,6 @@ make_image:
- docker:26.1.3-dind
before_script:
- unset DOCKER_HOST
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
@@ -72,6 +69,8 @@ Push latest:
# We do not need GitLab to clone the source code.
GIT_STRATEGY: none
stage: push
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
# 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
@@ -88,6 +87,8 @@ Push commit:
# Again, we do not need the source code here. Just playing with Docker.
GIT_STRATEGY: none
stage: push
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
@@ -101,6 +102,8 @@ Push tag:
only:
# We want this job to be run on tags only.
- tags
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG