From 9ba64b5140eae22866ebffdb924f75407104d3de Mon Sep 17 00:00:00 2001
From: andresanaya21 <alvaroandres.anayaamariles@telefonica.com>
Date: Wed, 15 Jan 2025 15:05:03 +0100
Subject: [PATCH] refactor: update docker login command in
 ci_staging.gitlab-ci.yml to use password-stdin for improved security

---
 capif/templates/ci_staging.gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/capif/templates/ci_staging.gitlab-ci.yml b/capif/templates/ci_staging.gitlab-ci.yml
index 94209bf..fafbc45 100644
--- a/capif/templates/ci_staging.gitlab-ci.yml
+++ b/capif/templates/ci_staging.gitlab-ci.yml
@@ -338,7 +338,7 @@ staging_build_and_push_mr:
    - export TMP_PWD=$PWD
    - echo "TMP_PWD=$TMP_PWD"
    - echo "### docker login###"
-   - 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