Created
June 3, 2020 06:15
-
-
Save gwsu2008/c99964c55cce59aadb149d2834d5ceaf to your computer and use it in GitHub Desktop.
jenkins-auto-approve-script.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval | |
ScriptApproval scriptApproval = ScriptApproval.get() | |
scriptApproval.pendingScripts.each { | |
scriptApproval.approveScript(it.hash) | |
} | |
/* Script to clear script approval | |
$JENKINS_HOME/init.groovy.d/disable-script-security.groovy: | |
*/ | |
import javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration | |
import jenkins.model.GlobalConfiguration | |
// disable Job DSL script approval | |
GlobalConfiguration.all().get(GlobalJobDslSecurityConfiguration.class).useScriptSecurity=false | |
GlobalConfiguration.all().get(GlobalJobDslSecurityConfiguration.class).save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this helped me. thank you!