From 4c5442c5fd78e3548dd3402b21e4921044d8c170 Mon Sep 17 00:00:00 2001 From: elijah0kello Date: Mon, 26 Aug 2024 01:38:33 +0200 Subject: [PATCH] ci: refactored publish jobs --- .circleci/config.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d9a79e..9015c97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -329,15 +329,6 @@ jobs: executor: default-machine steps: - checkout - - run: - name: Setup for LATEST release - command: | - echo "export RELEASE_TAG=$RELEASE_TAG_PROD" >> $BASH_ENV - echo "RELEASE_TAG=$RELEASE_TAG_PROD" - - PACKAGE_VERSION=$(cat package-lock.json | jq -r .version) - echo "export PACKAGE_VERSION=${PACKAGE_VERSION}" >> $BASH_ENV - echo "PACKAGE_VERSION=${PACKAGE_VERSION}" - attach_workspace: at: /tmp - run: @@ -355,6 +346,12 @@ jobs: if [[ $dir == *-core-connector/ ]]; then dir_no_slash="${dir%/}" # Remove trailing slash cd "$dir_no_slash" + echo "export RELEASE_TAG=$RELEASE_TAG_PROD" >> $BASH_ENV + echo "RELEASE_TAG=$RELEASE_TAG_PROD" + + PACKAGE_VERSION=$(cat package-lock.json | jq -r .version) + echo "export PACKAGE_VERSION=${PACKAGE_VERSION}" >> $BASH_ENV + echo "PACKAGE_VERSION=${PACKAGE_VERSION}" docker tag $DOCKER_ORG/$dir_no_slash:local $DOCKER_ORG/$dir_no_slash:$CIRCLE_TAG docker tag $DOCKER_ORG/$dir_no_slash:local $DOCKER_ORG/$dir_no_slash:$RELEASE_TAG echo "Publishing $DOCKER_ORG/$dir_no_slash:$CIRCLE_TAG" @@ -369,15 +366,6 @@ jobs: executor: default-machine steps: - checkout - - run: - name: Setup for SNAPSHOT release - command: | - echo "export RELEASE_TAG=$RELEASE_TAG_SNAPSHOT" >> $BASH_ENV - echo "RELEASE_TAG=$RELEASE_TAG_SNAPSHOT" - - PACKAGE_VERSION=$(cat package-lock.json | jq -r .version) - echo "export PACKAGE_VERSION=${PACKAGE_VERSION}" >> $BASH_ENV - echo "PACKAGE_VERSION=${PACKAGE_VERSION}" - attach_workspace: at: /tmp - run: @@ -395,6 +383,12 @@ jobs: if [[ $dir == *-core-connector/ ]]; then dir_no_slash="${dir%/}" # Remove trailing slash cd "$dir_no_slash" + echo "export RELEASE_TAG=$RELEASE_TAG_SNAPSHOT" >> $BASH_ENV + echo "RELEASE_TAG=$RELEASE_TAG_SNAPSHOT" + + PACKAGE_VERSION=$(cat package-lock.json | jq -r .version) + echo "export PACKAGE_VERSION=${PACKAGE_VERSION}" >> $BASH_ENV + echo "PACKAGE_VERSION=${PACKAGE_VERSION}" docker tag $DOCKER_ORG/$dir_no_slash:local $DOCKER_ORG/$dir_no_slash:$CIRCLE_TAG docker tag $DOCKER_ORG/$dir_no_slash:local $DOCKER_ORG/$dir_no_slash:$RELEASE_TAG echo "Publishing $DOCKER_ORG/$dir_no_slash:$CIRCLE_TAG"