From 1e63af9e33108751d1961e364e935a91616881c6 Mon Sep 17 00:00:00 2001 From: andresanaya21 <alvaroandres.anayaamariles@telefonica.com> Date: Mon, 13 Jan 2025 16:51:04 +0100 Subject: [PATCH] refactor: update docker login command to use CI_JOB_TOKEN for improved security --- capif/templates/ci_dev.gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/capif/templates/ci_dev.gitlab-ci.yml b/capif/templates/ci_dev.gitlab-ci.yml index 3edbc00..df5ce9d 100644 --- a/capif/templates/ci_dev.gitlab-ci.yml +++ b/capif/templates/ci_dev.gitlab-ci.yml @@ -128,7 +128,8 @@ dev_build_and_push: - export TMP_PWD=$PWD - echo "TMP_PWD=$TMP_PWD" - echo "### docker login###" - - docker login --username $CI_REGISTRY_USER --password $CAPIF_DOCKER_REGISTRY $CI_REGISTRY +# - docker login --username $CI_REGISTRY_USER --password $CAPIF_DOCKER_REGISTRY $CI_REGISTRY + - echo "$CI_JOB_TOKEN" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin - echo "----------------------------------------------------" - echo "### build and push nginx image###" - cd $TMP_PWD/services/nginx/ -- GitLab