diff options
author | dd <91662885+dd010101@users.noreply.github.com> | 2024-07-03 10:48:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-03 10:48:33 +0200 |
commit | 01b14b0f8597d3f42bff3eb32efbe3c17b064651 (patch) | |
tree | a6529bda7fa3b43ca13961307dcfba469ca13c7d | |
parent | ddbba63f14348afcb4a76b8d2cbe16dc99b04332 (diff) | |
parent | 2c411f0a316a63c0e716414b0d775639267dbbe3 (diff) | |
download | vyos-jenkins-01b14b0f8597d3f42bff3eb32efbe3c17b064651.tar.gz vyos-jenkins-01b14b0f8597d3f42bff3eb32efbe3c17b064651.zip |
Merge pull request #30 from GurliGebis/better-way-to-skip
Move branch filter logic
-rw-r--r-- | auto/helper-logic | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/auto/helper-logic b/auto/helper-logic index 7642c9a..7c1360c 100644 --- a/auto/helper-logic +++ b/auto/helper-logic @@ -423,6 +423,11 @@ function BuildJobs { for BRANCH in $BRANCHES do + # Branch filter + if ! echo $BRANCH | grep -E "$SELECTED_BRANCH_REGEX" > /dev/null; then + continue + fi + JOBS+=( "$JOB_NAME|$BRANCH" ) done done < <(cat $1 | jq -c '.[]') @@ -484,12 +489,6 @@ function BuildJobs { JOB_NAME="${jobSplit[0]}" JOB_BRANCH="${jobSplit[1]}" - # Branch filter - if ! echo $JOB_BRANCH | grep -E "$SELECTED_BRANCH_REGEX" > /dev/null; then - PrintJobExcluded $JOB_NAME $JOB_BRANCH - continue - fi - # Download job data and parse it. URL="${JENKINS_URL}/job/${JOB_NAME}/job/${JOB_BRANCH}/lastBuild/api/json" DATA=$(curl -Ss -g --fail-with-body "$URL") @@ -565,12 +564,6 @@ function BuildJobs { JOB_NAME="${jobSplit[0]}" JOB_BRANCH="${jobSplit[1]}" - # Branch filter - if ! echo $JOB_BRANCH | grep -E "$SELECTED_BRANCH_REGEX" > /dev/null; then - PrintJobExcluded $JOB_NAME $JOB_BRANCH - continue - fi - # Download job data and parse it. URL="${JENKINS_URL}/job/${JOB_NAME}/job/${JOB_BRANCH}/lastBuild/api/json" DATA=$(curl -Ss -g --fail-with-body "$URL") |