@Initializer(after=JOB_LOADED)
public static void init(Hudson h) throws IOException {
URL bundledInitScript = h.servletContext.getResource("/WEB-INF/init.groovy");
if (bundledInitScript!=null) {
LOGGER.info("Executing bundled init script: "+bundledInitScript);
execute(new GroovyCodeSource(bundledInitScript));
}
File initScript = new File(h.getRootDir(),"init.groovy");
if(initScript.exists()) {
LOGGER.info("Executing "+initScript);
execute(new GroovyCodeSource(initScript));
}
}