mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
initialization script allows Hudson to run a post-boot processing.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16054 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
9f4382cc44
commit
95533ee718
1 file changed
+14
@@ -183,6 +183,8 @@ import java.util.regex.Pattern;
|
||||
import java.nio.charset.Charset;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
|
||||
import groovy.lang.GroovyShell;
|
||||
|
||||
/**
|
||||
* Root object of the system.
|
||||
*
|
||||
@@ -543,6 +545,18 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
|
||||
|
||||
LoadStatistics.register();
|
||||
NodeProvisioner.launch();
|
||||
|
||||
// run the initialization script, if it exists.
|
||||
File initScript = new File(getRootDir(),"init.groovy");
|
||||
if(initScript.exists()) {
|
||||
LOGGER.info("Executing "+initScript);
|
||||
GroovyShell shell = new GroovyShell();
|
||||
try {
|
||||
shell.evaluate(initScript);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TcpSlaveAgentListener getTcpSlaveAgentListener() {
|
||||
|
||||
Reference in new issue
Block a user