当前位置: 首页>>代码示例>>Java>>正文


Java InitMilestone.JOB_LOADED属性代码示例

本文整理汇总了Java中hudson.init.InitMilestone.JOB_LOADED属性的典型用法代码示例。如果您正苦于以下问题:Java InitMilestone.JOB_LOADED属性的具体用法?Java InitMilestone.JOB_LOADED怎么用?Java InitMilestone.JOB_LOADED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在hudson.init.InitMilestone的用法示例。


在下文中一共展示了InitMilestone.JOB_LOADED属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: jobLoaded

@Initializer(before = InitMilestone.COMPLETED, after = InitMilestone.JOB_LOADED)
public static void jobLoaded() throws IOException
{
	m_logger.fine("Initialization milestone: All jobs have been loaded"); //$NON-NLS-1$
	Jenkins jenkins = Jenkins.getInstance();
	for (AbstractProject<?, ?> project : jenkins.getAllItems(AbstractProject.class))
	{
		try
		{
			SCM scmConfig = project.getScm();
			if (scmConfig instanceof AbstractConfiguration && ((AbstractConfiguration) scmConfig).isMigrated())
			{
				project.save();

				m_logger.info(String.format(
								"Project %s has been migrated.", //$NON-NLS-1$
								project.getFullName()));
			}
		}
		catch (IOException e)
		{
			m_logger.log(Level.SEVERE, String.format("Failed to upgrade job %s", project.getFullName()), e); //$NON-NLS-1$
		}
	}
}
 
开发者ID:jenkinsci,项目名称:compuware-scm-downloader-plugin,代码行数:25,代码来源:AbstractConfiguration.java

示例2: packageRenameConverting

@Initializer(before = InitMilestone.JOB_LOADED)
@Restricted(NoExternalUse.class)
public static void packageRenameConverting() {
    for(XStream2 xs : Arrays.asList(Items.XSTREAM2, Run.XSTREAM2, Jenkins.XSTREAM2, getFingerprintXStream())) {
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.DockerHubTrigger",
                                 DockerHubTrigger.class);
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.DockerHubWebHookCause",
                                 DockerHubWebHookCause.class);
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.DockerPullImageBuilder",
                                 DockerPullImageBuilder.class);
        //TODO no back-compat tests for the column and filter
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.TriggerListViewColumn",
                                 TriggerListViewColumn.class);
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.TriggerViewFilter",
                                 TriggerViewFilter.class);
        //The TriggerOption extension point has also changed package name and will not be backwards compatible API
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.opt.impl.TriggerForAllUsedInJob",
                                 TriggerForAllUsedInJob.class);
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.opt.impl.TriggerOnSpecifiedImageNames",
                                 TriggerOnSpecifiedImageNames.class);
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.TriggerStore$TriggerEntry",
                                 TriggerStore.TriggerEntry.class);
        xs.addCompatibilityAlias("org.jenkinsci.plugins.dockerhub.notification.TriggerStore$TriggerEntry$RunEntry",
                                 TriggerStore.TriggerEntry.RunEntry.class);
    }
}
 
开发者ID:jenkinsci,项目名称:dockerhub-notification-plugin,代码行数:26,代码来源:DockerHubTrigger.java

示例3: initialize

@Initializer(after = InitMilestone.JOB_LOADED)
public static void initialize() {
    new Thread(new Runnable() {
        @Override
        public void run() {
            ACL.impersonate(ACL.SYSTEM, new ListenerInitializerTask(GitLabSCMWebHook.get()));
        }
    }).start();
}
 
开发者ID:Argelbargel,项目名称:gitlab-branch-source-plugin,代码行数:9,代码来源:GitLabSCMWebHook.java

示例4: initialize

/**
 * Let's trigger an update after Jenkins is fully up.
 *
 * JOB_LOADED is the last milestone that can be triggered with an @Initializer,
 * COMPLETED doesn't work. So, we queue the update and check that Jenkins is fully up in the runnable
 * used in refreshDataOnStartup()
 */
@Initializer(after = InitMilestone.JOB_LOADED)
public static void initialize() {
    // TODO switch to Jenkins.getActiveInstance() once 1.590+ is the baseline
    Jenkins jenkins = Jenkins.getInstance();
    if (jenkins == null) {
        throw new IllegalStateException("Jenkins has not been started, or was already shut down");
    }
    QuickDiskUsagePlugin plugin = jenkins.getPlugin(QuickDiskUsagePlugin.class);
    if (plugin == null) return;
    plugin.refreshDataOnStartup();
}
 
开发者ID:jenkinsci,项目名称:cloudbees-disk-usage-simple-plugin,代码行数:18,代码来源:QuickDiskUsageInitializer.java

示例5: init

/**
 * We want to start the Mesos scheduler as part of the initialization of Jenkins
 * and after the cloud class values have been restored from persistence.If this is
 * the very first time, this method will be NOOP as MesosCloud is not registered yet.
 */

@Initializer(after=InitMilestone.JOB_LOADED)
public static void init() {

  Jenkins jenkins = getJenkins();
  List<Node> slaves = jenkins.getNodes();

  // Turning the AUTOMATIC_SLAVE_LAUNCH flag off because the below slave removals
  // causes computer launch in other slaves that have not been removed yet.
  // To study how a slave removal updates the entire list, one can refer to
  // Hudson NodeProvisioner class and follow this method chain removeNode() ->
  // setNodes() -> updateComputerList() -> updateComputer().
  Jenkins.AUTOMATIC_SLAVE_LAUNCH = false;
  for (Node n : slaves) {
    //Remove all slaves that were persisted when Jenkins shutdown.
    if (n instanceof MesosSlave) {
      ((MesosSlave)n).terminate();
    }
  }

  // Turn it back on for future real slaves.
  Jenkins.AUTOMATIC_SLAVE_LAUNCH = true;

  for (Cloud c : jenkins.clouds) {
    if( c instanceof MesosCloud) {
      // Register mesos framework on init, if on demand registration is not enabled.
      if (!((MesosCloud) c).isOnDemandRegistration()) {
        ((MesosCloud)c).restartMesos();
      }
    }
  }
}
 
开发者ID:jenkinsci,项目名称:mesos-plugin,代码行数:37,代码来源:MesosCloud.java

示例6: loadConfig

@Initializer(after = InitMilestone.EXTENSIONS_AUGMENTED, before = InitMilestone.JOB_LOADED)
public static void loadConfig() throws IOException {
    SupportPlugin instance = getInstance();
    if (instance != null)
        instance.load();
}
 
开发者ID:jenkinsci,项目名称:support-core-plugin,代码行数:6,代码来源:SupportPlugin.java


注:本文中的hudson.init.InitMilestone.JOB_LOADED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。