From db443e10b879de5359dad0d18febe9ff324b7f48 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Mon, 22 Oct 2018 15:16:47 -0700 Subject: [PATCH] circle.yml: Only push tagged images on tagged commits Change-type: patch Signed-off-by: Pablo Carranza Velez --- circle.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 95da24d0..b37a59e7 100644 --- a/circle.yml +++ b/circle.yml @@ -16,6 +16,7 @@ defaults: &defaults jq \ git \ bash \ + grep \ nodejs \ nodejs-npm \ openssh-client @@ -36,8 +37,9 @@ defaults: &defaults name: Build $ARCH-supervisor no_output_timeout: 10800 command: | - VERSION_TAG=v$(jq .version package.json | sed 's/"//g') - if [ "${CIRCLE_BRANCH}" = "master" ]; then + VERSION_TAG=v$(jq --raw-output .version package.json) + GIT_TAG=$(git describe --tags | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' || echo "") + if [ "${VERSION_TAG}" = "${GIT_TAG}" ]; then export EXTRA_TAG=$VERSION_TAG fi echo "Starting build.sh"