Load Script Approval from another Jenkins instance

654 views
Skip to first unread message

Sverre Moe

unread,
Aug 8, 2016, 6:36:13 AM8/8/16
to Jenkins Users
I have had a test instance of Jenkins running while programming my workflow scripts. In this process I have had to go into In-process Script Approval time and time again to add method calls to the approved list.
Now I have the need to load these into Jenkins production instance and I cannot run through the workflow scripts in the same way as I did in testing. There are aprox 15-20 approved methods. Having to run a test project 15-20 times to add methods to approved list is tedious.

Björn Pedersen

unread,
Aug 9, 2016, 4:45:11 AM8/9/16
to Jenkins Users
Hi,

the approvals are stored in scriptApprovals.xml as hashes. I am not sure  if this file is transferrable, but from looking  at the code (https://github.com/jenkinsci/script-security-plugin/blob/master/src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java) it seems so.

Björn

Sverre Moe

unread,
Aug 10, 2016, 6:19:56 AM8/10/16
to Jenkins Users
It looks like it worked. I copied the scriptApproval.xml over to the production Jenkins and I found the approved methods listed there.
Will know for sure if it works when I start my first production build.

I just added a few lines of new code and tried it out on my test Jenkins. I had to execute a build 8 times to each time add a new method to the approved list. This procedure to add to script approval one method at a time is ludicrous and time consuming.
Reply all
Reply to author
Forward
0 new messages