Skip to content

Commit 3d802b2

Browse files
committed
chore: add --job parameter to do-exclusively
ALlows the script to await on specific jobs of a branch, instead of the whole branch.
1 parent ea1cad7 commit 3d802b2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
export IMAGE_TAG=$([[ "$CIRCLE_BRANCH" == "staging" ]] && echo "staging-candidate" || echo "discardable") &&
212212
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=snyk/kubernetes-monitor:${IMAGE_TAG}-${CIRCLE_SHA1} &&
213213
docker pull ${KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG} &&
214-
.circleci/do-exclusively --branch staging npm run test:integration:eks
214+
.circleci/do-exclusively --branch staging --job ${CIRCLE_JOB} npm run test:integration:eks
215215
- run:
216216
name: Notify Slack on failure
217217
command: |

.circleci/do-exclusively

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ parse_args() {
88
case $1 in
99
-b|--branch) branch="$2" ;;
1010
-t|--tag) tag="$2" ;;
11+
-j|--job) job="$2" ;;
1112
*) break ;;
1213
esac
1314
shift 2
@@ -43,6 +44,10 @@ make_jq_prog() {
4344
jq_filters+=" and (.subject | contains(\"[$tag]\"))"
4445
fi
4546

47+
if [[ $job ]]; then
48+
jq_filters+=" and .workflows.job_name == \"$job\""
49+
fi
50+
4651
jq_prog=".[] | select(.build_num < $CIRCLE_BUILD_NUM and (.status | test(\"running|pending|queued\")) $jq_filters) | .build_num"
4752
}
4853

0 commit comments

Comments
 (0)