Skip to content

Commit bf5a00f

Browse files
committed
Use variable for login
Signed-off-by: Federico Busetti <[email protected]>
1 parent 8890f26 commit bf5a00f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.gitlab_ci/_templates.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variables:
2121
script:
2222
- docker buildx create --use
2323
- docker buildx inspect --bootstrap
24-
- echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
24+
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_PASSWORD --password-stdin $CI_REGISTRY
2525
- echo "Building $DOCKER_IMAGE_FULL_TAG - Cache from $DOCKER_IMAGE_NAME:cache"
2626
- |
2727
docker buildx build --push \
@@ -52,7 +52,7 @@ variables:
5252
services:
5353
- docker:$DOCKER_VERSION-dind
5454
script:
55-
- echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
55+
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_PASSWORD --password-stdin $CI_REGISTRY
5656
# Remove the UTC offset, not supported by `date` in docker image (busybox)
5757
- export CLEAN_DATETIME=$(echo "$CI_COMMIT_TIMESTAMP" | sed 's/+00:00//' | sed 's/Z//')
5858
# Transform in unix timestamp

0 commit comments

Comments
 (0)