Last active
December 19, 2015 03:08
-
-
Save patoarvizu/5888008 to your computer and use it in GitHub Desktop.
Iterate over a file called branches (that should contain a list of branches to be built, one in each line) and triggers another Jenkins job via the REST API and authenticating with the API Token.
It pulls the missing revisions from ALL branches as a final step.
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
for branch in $(cat branches) | |
do | |
echo "---------------" | |
echo "Branch: $branch" | |
json="{\"parameter\": [{\"name\": \"branch\", \"value\": \"$branch\"}]}" | |
curl -F json="$json" -u $1:$2 $JENKINS_URL/job/$2/build?token=$4 | |
done | |
hg pull -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Invocation:
JobForEachBranch.sh jenkinsUsername jenkinsAPIToken targetJob targetJobToken