I am creating a Jenkins job with a DSL Groovy script to add the Veracode plugin. I am looking for a way to tick the "Use global Veracode user credentials" check box.
It works fine with the code I have and adds the checkbox but doesn't check it for me and is looking for credentials. I would like to use global credentials. I have added it under the publishers block. As you can see in my code, under the credentials section, I leave the credentials blank as I don't want to specify any of those. Clicking the "Use global Veracode user credentials" check box, omits these params and uses the global params specified under manage jenkins.
My problem is how to get this checkbox ticked using the script.
publishers {
//extendedEmail Utilities.getExtendedEmail("Scan_Services", false, false)
extendedEmail Utilities.getExtendedEmailRequester("Scan_Services", false, false)
veracodeNotifier {
// Enter the name of the application.
appname("xDistributor")
// Enter the business criticality for the application.
criticality("Very High")
// Enter a name for the static scan you want to submit to the Veracode Platform for this application.
version("$BUILD_TIMESTAMP" + " Services_Scan")
// Enter the filepaths of the files to upload for scanning, represented as a comma-separated list of ant-style include patterns relative to the job's workspace root directory.
uploadincludespattern("**/Services/webapps/services.war")
createprofile(false)
sandboxname("")
createsandbox(false)
filenamepattern("")
replacementpattern("")
uploadexcludespattern("")
scanincludespattern("")
scanexcludespattern("")
waitForScan(false)
timeout("")
credentials {
vapicredential("")
vuser("")
vpassword("")
}
}
}
I wasn't able to find any documentation from Veracode on this, so I ended up having to decompile the plugin to figure it out. This can be accomplished by setting the credentials object to a null value.
job('job-name') {
publishers {
veracodeNotifier {
credentials(null)
}
}
}
The way this works, is the configuration settings for the Veracode plugin is not checking for a value of a field, it is checking that the credentials object is null, and that the global credentials are set.