Skip to content

Commit

Permalink
Merge pull request cloud-bulldozer#746 from vishnuchalla/job_type
Browse files Browse the repository at this point in the history
Adding job_type to the fingerprint index
  • Loading branch information
paigerube14 committed Feb 12, 2025
1 parent 2cde75f commit cb53b6a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions utils/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ setup(){
elif [[ -n $BUILD_ID ]]; then
export ci="JENKINS"
export build_url=${BUILD_URL}
LATEST_CAUSE=$(curl -s "${BUILD_URL}"/api/json | jq -r '.actions[].causes[].shortDescription' 2>/dev/null | grep -v "null" | tail -n 1)
if echo "$LATEST_CAUSE" | grep -iq "SCM"; then
job_type="scm trigger"
elif echo "$LATEST_CAUSE" | grep -iq "timer"; then
job_type="time trigger"
elif echo "$LATEST_CAUSE" | grep -iq "upstream"; then
job_type="upstream trigger"
elif echo "$LATEST_CAUSE" | grep -iq "user"; then
job_type="manual trigger"
else
job_type="unknown"
fi
fi

export UUID=$UUID
Expand Down

0 comments on commit cb53b6a

Please sign in to comment.