Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

seed job asks for script approval in jenkins

I was trying to execute a seed job(having github url with groovy scripts) in jenkins and got following error.

First time build. Skipping changelog.
Processing DSL script APIServerDeployer.groovy
ERROR: script not yet approved for use
Finished: FAILURE

like image 206
ricky Avatar asked Apr 29 '17 18:04

ricky


People also ask

What is script approval in Jenkins?

This protection is provided by the Script Security plugin. As soon as an unsafe method is used in any of the scripts, the administrator can use the "In-process Script Approval" action appears in Manage Jenkins to allow the unsafe method. Unsafe methods should not be enabled without careful consideration of the impact.

How do I approve Jenkins approval?

The “Role-based Authorization Strategy” plugin must first be installed in the “Managed Jenkins… Manage Plugins” dialog. 2. Then the role-based strategy is selected in the “Manage Jenkins…Configure Global Security” dialog and in the Authorization section select “Role-Based Strategy”.

How do I run a seed job in Jenkins?

To create the seed job, go to your_jenkins_url , log in (if necessary), click the New Item link on the left of the dashboard. On the screen that follows, type in seed , select Freestyle project, and click OK. In the screen that follows, scroll down to the Build section and click on the Add build step dropdown.

What is Scriptler script?

Scriptler allows you to store/edit groovy scripts and execute it on any of the agents/nodes... no need to copy/paste groovy code anymore. Besides administering your scripts, Scriptler also provides a way to share scripts between users via hosted script catalogs on the internet.


2 Answers

In order to get past this Jenkins security feature, you will need to approve your script. Go to Manage Jenkins -> In-process Script Approval. In that screen, you will see the script that you are trying to execute. There should be an approve button that you'll need to click to approve that script.

enter image description here

like image 72
Erwin Alberto Avatar answered Sep 20 '22 21:09

Erwin Alberto


Job DSL version 1.60 introduced Script Security, to restore old behavior, uncheck Enable script security for Job DSL scripts in the CSRF Protection section of the "Configure Global Security" page. This should only be done if you have another way of approving scripts, such as through git pull request approval if your seed job builds jobs living in git.

like image 32
edst Avatar answered Sep 19 '22 21:09

edst