asked on
JENKINS_SERVER=http://umount-altmount:8090
JOB_NAME=get_shelved_job
job_status=`curl http://${JENKINS_SERVER}/job/${JOB_NAME}/lastBuild/api/json | grep "\"result\":\"SUCCESS\""`
if [ -n "$job_status" ]
then
# Run your script commands here
echo "Build Sucess"
else
echo "BUILD FAILURE: Other build is unsuccessful or status could not be obtained."
exit 1
fi