提交 744be9d1 编写于 作者: O Oleg Nenashev

[JENKINS-61694] - Update Groovy Init hooks to run after all job configurations are adapted

上级 55b67fa0
......@@ -106,14 +106,15 @@ public enum InitMilestone implements Milestone {
JOB_LOADED("Loaded all jobs"),
/**
* By this milestone, any job configuration is adapted or updated just in case any plugin needs to update former/old configurations or init scripts
* By this milestone, any job configuration is adapted or updated just in case any plugin needs to update former/old configurations.
* It does not include {@link hudson.init.impl.GroovyInitScript}s which get executed later
* @since 2.220
*/
JOB_CONFIG_ADAPTED("Configuration for all jobs updated"),
/**
* The very last milestone
*
* The very last milestone.
* All executions should be completed by it, including {@link hudson.init.impl.GroovyInitScript}s.
* This is used in {@link Initializer#before()} since annotations cannot have null as the default value.
*/
COMPLETED("Completed initialization");
......
......@@ -32,11 +32,12 @@ import static hudson.init.InitMilestone.*;
/**
* Run the initialization script, if it exists.
* It runs strictly after the initialization of other tasks during the last initialization milestone.
*
* @author Kohsuke Kawaguchi
*/
public class GroovyInitScript {
@Initializer(after=JOB_LOADED)
@Initializer(after=JOB_CONFIG_ADAPTED)
public static void init(Jenkins j) {
new GroovyHookScript("init", j.servletContext, j.getRootDir(), j.getPluginManager().uberClassLoader).run();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册