Reputation: 7799
I use configuration-as-code plugin to set up my Jenkins. The setup works and I see my job inside the Jenkins GUI.
If I now run it, I get the following error:
org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException: script not yet approved for use
I know if I manually approve the job, I can run it.
But how can I automatically approve these jobs?
Upvotes: 0
Views: 240
Reputation: 1239
You can use Configuration-as-Code JCasC Plugin to automate the approving process.
import org.jenkinsci.plugins.scriptsecurity.scripts.approvalProcess;
def approvalProcess= approvalProcess.get();
approvalProcess.approveSignature('YourScriptsSingature');
approvalProcess.save();
Upvotes: 0