Skip to content

Instantly share code, notes, and snippets.

@nullbyte61
Created October 22, 2020 17:27
Show Gist options
  • Save nullbyte61/5ca429b3b0afec3fd666d2edb4272816 to your computer and use it in GitHub Desktop.
Save nullbyte61/5ca429b3b0afec3fd666d2edb4272816 to your computer and use it in GitHub Desktop.
misc scripts
#! /bin/bash
jobUrl=$1 #https://<jenkins-Job-URL>/
searchUser=$2 #<short-username>
#lastBuild=$(curl -s $jobUrl/api/json\?pretty\=true | jq '.lastBuild.number')
##TODO:
# Calculate fist and last available build numbers
# Generate the range from those numbers...
for runId in {2114..2164}
do
runApiUrl="$jobUrl$runId/api/json?pretty=true"
user=$(curl -s $runApiUrl | jq '.actions[1].causes[0].userId')
[ $user ] && [ $user = \"$searchUser\" ] && echo $user triggered build number $runId
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment