From 3e49bb16b43e07cfce9805ceafaddbb9d3261010 Mon Sep 17 00:00:00 2001 From: guseggert <877588+guseggert@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:03:01 -0400 Subject: [PATCH] ci: publish Docker images for bifrost-* branches --- .circleci/config.yml | 4 +++- bin/push-docker-tags.sh | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a37479ab02..b707962a263 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -428,7 +428,9 @@ workflows: branches: only: - master - - feat/stabilize-dht + # the bifrst-* branches are used for deploying code that hasn't hit master yet (e.g. for testing) + - /^bifrost-.*/ + # NOTE: CircleCI only builds tags if you explicitly filter for them. That # also means tag-based jobs can only depend on other tag-based jobs, so we diff --git a/bin/push-docker-tags.sh b/bin/push-docker-tags.sh index f8a2d09fe17..91d06a427f2 100755 --- a/bin/push-docker-tags.sh +++ b/bin/push-docker-tags.sh @@ -67,6 +67,11 @@ elif [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then pushTag "latest" pushTag "release" # see: https://github.com/ipfs/go-ipfs/issues/3999#issuecomment-742228981 +elif [[ $GIT_BRANCH =~ ^bifrost-.* ]]; then + # sanitize the branch name since docker tags have stricter char limits than git branch names + branch=$(echo "$GIT_BRANCH" | tr '/' '-' | tr --delete --complement '[:alnum:]-') + pushTag "${branch}-${BUILD_NUM}-${GIT_SHA1_SHORT}" + elif [ "$GIT_BRANCH" = "master" ]; then pushTag "master-${BUILD_NUM}-${GIT_SHA1_SHORT}" pushTag "master-latest"