Add use of post build info json

This commit is contained in:
Dan Hawkins 2021-11-17 21:25:47 +00:00
commit 951d694051

View file

@ -44,13 +44,15 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam
}
}
}
def jobitem = Jenkins.instance.getItemByFullName(jobname)
if (jobitem) {
if (!jobitem.isBuildable()) {
if (!jobname) {
def jobitem = Jenkins.instance.getItemByFullName(jobname)
if (jobitem) {
if (!jobitem.isBuildable()) {
jobname = ''
}
} else {
jobname = ''
}
} else {
jobname = ''
}
return jobname
}
@ -86,7 +88,7 @@ def performSuccessfulBuildActions() {
def postbuildinfo = readJSON(text: POST_BUILD_INFO)
def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1)
echo "Post build info:\n${postbuildjsontext}"
postbuildactions = postbuildinfo['Build outcomes']['Success']['Action']
postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions']
postbuildinfoavailable = true
}
def String buildselector = "<SpecificBuildSelector plugin='copyartifact@1.46.2'><buildNumber>${BUILD_NUMBER}</buildNumber></SpecificBuildSelector>"