Skip to content

Commit

Permalink
ci: refactored publish jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah0kello committed Aug 25, 2024
1 parent 94f0e49 commit 4c5442c
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand All @@ -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:
Expand All @@ -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"
Expand Down

0 comments on commit 4c5442c

Please sign in to comment.