File tree Expand file tree Collapse file tree 3 files changed +18
-24
lines changed
Expand file tree Collapse file tree 3 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ check_track_exist() {
1717 # Load TRACK_EXISTS variable from file previously stored in the tmp folder
1818 # shellcheck disable=SC1091
1919 source " /tmp/TRACK_STATUS"
20- if [[ " $TRACK_EXISTS " != " true" && ! " $CIRCLE_BRANCH " =~ ^gtmq_ ]]; then
20+
21+ if [[ " $TRACK_EXISTS " != " true" ]]; then
2122 echo " Track does not exist! avoiding update!"
2223 exit 0
2324 fi
@@ -92,7 +93,6 @@ add_additional_tags() {
9293update_track () {
9394 # ## update the track
9495 BUCKET=" com.voiceflow.ci.assets"
95- TRACK=" tracks/${COMPONENT} /${CIRCLE_BRANCH} "
9696 echo " TRACK: $TRACK "
9797
9898 mkdir -p " $( dirname " /tmp/$TRACK " ) "
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ echo "${BUCKET?}"
77
88BRANCH_NAME=" $CIRCLE_BRANCH "
99if [[ -z " $CIRCLE_BRANCH " && -n " $CIRCLE_TAG " ]]; then
10- BRANCH_NAME=" master"
10+ BRANCH_NAME=" master"
1111fi
1212
1313TRACK=" tracks/$COMPONENT /$BRANCH_NAME "
@@ -18,13 +18,18 @@ SEARCH_TRACK_RESULT=$?
1818set -e
1919
2020# Store the result on a file in tmp folder to use in future steps
21- if [[ $SEARCH_TRACK_RESULT -eq 0 ]]; then
22- echo ' export TRACK_EXISTS="true"' > /tmp/TRACK_STATUS # Track exists, skip following steps
21+ if [[ $SEARCH_TRACK_RESULT -eq 0 || " $CIRCLE_BRANCH " =~ ^gtmq_ ]]; then
22+ # Track exists, skip following steps
23+ cat << -EOF >/tmp/TRACK_STATUS
24+ export TRACK_EXISTS="true"
25+ export TRACK="${TRACK} "
26+ EOF
27+
2328else
24- echo ' export TRACK_EXISTS="false"' > /tmp/TRACK_STATUS # Track exists, skip following steps
25- if (( STOP )) ; then
26- curl --request POST \
27- --url " https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID /cancel" \
28- --header " Circle-Token: ${CIRCLECI_API_TOKEN} "
29- fi
29+ echo ' export TRACK_EXISTS="false"' > /tmp/TRACK_STATUS # Track does not exist
30+ if (( STOP)) ; then
31+ curl --request POST \
32+ --url " https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID /cancel" \
33+ --header " Circle-Token: ${CIRCLECI_API_TOKEN} "
34+ fi
3035fi
Original file line number Diff line number Diff line change @@ -26,20 +26,10 @@ read -r -a EXTRA_BUILD_ARGS <<<"$EXTRA_BUILD_ARGS"
2626# Load IMAGE_EXISTS variable from file previously stored in the tmp folder
2727# shellcheck disable=SC1091
2828source " /tmp/IMAGE_STATUS"
29- # Load TRACK_EXISTS variable from file previously stored in the tmp folder
30- # shellcheck disable=SC1091
31- source " /tmp/TRACK_STATUS"
32-
33- IS_GTMQ=$( grep -qE " ^gtmq_" - <<< " ${CIRCLE_BRANCH}" && echo 1 || echo 0)
3429
3530if [[ " $TRACK_EXISTS " != " true" ]]; then
36- if (( ! IS_GTMQ)) ; then
37- echo " Track does not exist! avoiding update!"
38- exit 0
39- fi
40-
41- echo " Track will be created for merge queue branch"
42- echo ' export TRACK_EXISTS="true"' > /tmp/TRACK_STATUS # Track exists, skip following steps
31+ echo " Track does not exist! avoiding update!"
32+ exit 0
4333fi
4434
4535if [[ -z " $CIRCLE_BRANCH " && -n " $CIRCLE_TAG " ]]; then
@@ -215,7 +205,6 @@ IMAGE_SHA="${IMAGE_SHA//sha256:/}"
215205update_track () {
216206 # ## update the track
217207 BUCKET=" com.voiceflow.ci.assets"
218- TRACK=" tracks/${COMPONENT} /${CIRCLE_BRANCH} "
219208 echo " TRACK: $TRACK "
220209
221210 mkdir -p " $( dirname " /tmp/$TRACK " ) "
You can’t perform that action at this time.
0 commit comments