From 64221f4aa6e73a4e09d015418c0af269d9167385 Mon Sep 17 00:00:00 2001 From: Zain Nasir Date: Thu, 9 Jan 2025 15:42:38 -0500 Subject: [PATCH 1/2] skip image build with conditional --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e4e45e17ed5..3b2c8602f4c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ commands: export DOCKER_TAG=$CIRCLE_SHA1 URL="https://hub.docker.com/v2/repositories/cbioportal/cbioportal-dev/tags/$DOCKER_TAG-web-shenandoah" TAG_FOUND=$(curl -s $URL | jq -r .name) - if [ $TAG_FOUND = "$DOCKER_TAG-web-shenandoah" ]; then + if [ $TAG_FOUND = "$DOCKER_TAG-web-shenandoah" ] && [ "<>" = "true" ]; then echo "Image already exists. Skipping build step!" exit 0 fi From 4236dba15df6ae7e89c665773558265efd9782f2 Mon Sep 17 00:00:00 2001 From: Zain Nasir Date: Thu, 9 Jan 2025 16:04:48 -0500 Subject: [PATCH 2/2] reuse image on workflow reruns --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b2c8602f4c..3d0dfeba7e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,8 +19,9 @@ commands: export DOCKER_TAG=$CIRCLE_SHA1 URL="https://hub.docker.com/v2/repositories/cbioportal/cbioportal-dev/tags/$DOCKER_TAG-web-shenandoah" TAG_FOUND=$(curl -s $URL | jq -r .name) - if [ $TAG_FOUND = "$DOCKER_TAG-web-shenandoah" ] && [ "<>" = "true" ]; then - echo "Image already exists. Skipping build step!" + if [ $TAG_FOUND = "$DOCKER_TAG-web-shenandoah" ]; then + echo "Image already exists. Pulling remote image and skipping build step!" + docker pull $DOCKER_REPO:$DOCKER_TAG-web-shenandoah exit 0 fi cd cbioportal-test