From 984eda4577425fea3df4bdec49e887a22819291d Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Wed, 28 Jun 2023 13:04:12 +0000 Subject: [PATCH 1/2] switching to job token --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c21556e..ae5dc79 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ variables: - docker:20.10.16-dind script: - "docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG || true" - - "docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY" + - "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY" - "docker build --cache-from $CI_REGISTRY_IMAGE:$IMAGE_TAG -t $CI_REGISTRY_IMAGE:$IMAGE_TAG -f $DOCKERFILE ." - "docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG" - 'if [ "${CI_COMMIT_REF_NAME}" = master ] ; then docker tag $CI_REGISTRY_IMAGE:$IMAGE_TAG $CI_REGISTRY_IMAGE:$IMAGE_TAG_RELEASE && docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG_RELEASE ; fi' -- GitLab From f72d29339bb365bad61c2c710f1fb612661df5bc Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Wed, 28 Jun 2023 14:13:54 +0000 Subject: [PATCH 2/2] login before pull --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae5dc79..2c71924 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,8 +8,8 @@ variables: services: - docker:20.10.16-dind script: - - "docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG || true" - "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY" + - "docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG" - "docker build --cache-from $CI_REGISTRY_IMAGE:$IMAGE_TAG -t $CI_REGISTRY_IMAGE:$IMAGE_TAG -f $DOCKERFILE ." - "docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG" - 'if [ "${CI_COMMIT_REF_NAME}" = master ] ; then docker tag $CI_REGISTRY_IMAGE:$IMAGE_TAG $CI_REGISTRY_IMAGE:$IMAGE_TAG_RELEASE && docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG_RELEASE ; fi' -- GitLab