From 70207a7dbc510dd6d3bf20a2fcc27b61252fffea Mon Sep 17 00:00:00 2001 From: Kevin Scholz Date: Tue, 10 May 2022 18:29:03 +0200 Subject: [PATCH] :recycle: Update registry login in Bitbucket pipeline --- bitbucket-pipelines/bitbucket-pipelines.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bitbucket-pipelines/bitbucket-pipelines.yml b/bitbucket-pipelines/bitbucket-pipelines.yml index c9af22b..46d16b2 100644 --- a/bitbucket-pipelines/bitbucket-pipelines.yml +++ b/bitbucket-pipelines/bitbucket-pipelines.yml @@ -12,6 +12,7 @@ pipelines: SETOPS_IMAGE=cowsay SETOPS_PROJECT=felix SETOPS_ORG=dev + SETOPS_REGISTRY=api.setops.co EOF if [[ "$BITBUCKET_BRANCH" == staging ]]; then @@ -23,9 +24,9 @@ pipelines: fi source setops-pipeline/.env - echo "SETOPS_TARGET_IMAGE_WEB_APP=api.setops.co/$SETOPS_ORG/$SETOPS_PROJECT/$APP_ENV/$SETOPS_WEB_APP:latest" >> setops-pipeline/.env - echo "SETOPS_TARGET_IMAGE_WORKER_APP=api.setops.co/$SETOPS_ORG/$SETOPS_PROJECT/$APP_ENV/$SETOPS_WORKER_APP:latest" >> setops-pipeline/.env - echo "SETOPS_TARGET_IMAGE_CLOCK_APP=api.setops.co/$SETOPS_ORG/$SETOPS_PROJECT/$APP_ENV/$SETOPS_CLOCK_APP:latest" >> setops-pipeline/.env + echo "SETOPS_TARGET_IMAGE_WEB_APP=$SETOPS_REGISTRY/$SETOPS_ORG/$SETOPS_PROJECT/$APP_ENV/$SETOPS_WEB_APP:latest" >> setops-pipeline/.env + echo "SETOPS_TARGET_IMAGE_WORKER_APP=$SETOPS_REGISTRY/$SETOPS_ORG/$SETOPS_PROJECT/$APP_ENV/$SETOPS_WORKER_APP:latest" >> setops-pipeline/.env + echo "SETOPS_TARGET_IMAGE_CLOCK_APP=$SETOPS_REGISTRY/$SETOPS_ORG/$SETOPS_PROJECT/$APP_ENV/$SETOPS_CLOCK_APP:latest" >> setops-pipeline/.env artifacts: - setops-pipeline/** @@ -53,9 +54,11 @@ pipelines: image: ghcr.io/setopsco/setops-cli:latest script: - source setops-pipeline/.env - - printf "%s\n%s\n%s\n" "$SETOPS_ORG" "$SETOPS_USER" "$SETOPS_PASSWORD" | setops login + - printf "%s\n%s\n%s\n" "$SETOPS_ORG" "$SETOPS_USER" "$SETOPS_PASSWORD" | setops login --service-user - base64 < /home/setops/.setops.yml > setops-pipeline/setops.yml - - setops registry:login -o plain | base64 > setops-pipeline/setops-registry.txt + - CURRENT_SETOPS_ACCESS_TOKEN=$(grep token /home/setops/.setops.yml | cut -d' ' -f2) + # only prepare login command for later + - echo "docker login -u _token -p \"$CURRENT_SETOPS_ACCESS_TOKEN\" $SETOPS_REGISTRY" | base64 > setops-pipeline/setops-registry.txt artifacts: - setops-pipeline/**