Last active
May 12, 2020 09:17
-
-
Save bvcelari/2b462752b8232bca967a2806c53d9195 to your computer and use it in GitHub Desktop.
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 hudson.license.LicenseManager | |
import hudson.security.ACL | |
import jenkins.model.Jenkins | |
import jenkins.util.groovy.GroovyHookScript | |
import java.io.File | |
import java.util.logging.Logger | |
Logger logger = Logger.getLogger("init.init_01_launch_auto_config.groovy") | |
ACL.impersonate(ACL.SYSTEM, new Runnable() { | |
@Override | |
public void run() { | |
def j = Jenkins.instance; | |
// load scripts from /var/jenkins_config/configure-jenkins.groovy and /var/jenkins_config/configure-jenkins.groovy.d/*.groovy | |
new GroovyHookScript("/var/jenkins_config/configure-jenkins", j.servletContext, new File(""), j.pluginManager.uberClassLoader).run(); | |
// load scripts from $HOME/configure-jenkins.groovy and $HOME/configure-jenkins.groovy.d/*.groovy | |
new GroovyHookScript("configure-jenkins").run(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment