Skip to main content
100%

Shell script to wait on a upstream jenkins job - a "block" node in an execution graph

✓ Published0🌍 Public
Aandyreagan
Last edited May 22, 2020
Created on May 22, 2020

A shell script uses the Jenkins REST API to wait for upstream jobs to finish, polling each job’s `/api/json?pretty=true` endpoint with Python’s `requests` and `json` libraries. It checks the `color` field for `"anime"` to detect a running build, sleeping 5 seconds between polls. After completion, it asserts that the last completed build equals the last successful build, confirming success. The script supports multiple upstream jobs by splitting a comma-separated `JOB_TO_WAIT_FOR` variable and tracking status in a list, effectively acting as a blocking node in an execution graph.

AI-generated description

Similar vizzes