Created
October 22, 2020 17:27
-
-
Save nullbyte61/5ca429b3b0afec3fd666d2edb4272816 to your computer and use it in GitHub Desktop.
misc scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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