public void building(AgentBuildingInfo agentBuildingInfo) { syncStatus(AgentRuntimeStatus.Building); agentRuntimeInfo.busy(agentBuildingInfo); }
private AgentRuntimeInfo buildingRuntimeInfo(AgentConfig agentConfig) { AgentRuntimeInfo runtimeInfo = new AgentRuntimeInfo(agentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false); runtimeInfo.busy(defaultBuildingInfo); return runtimeInfo; } }
private AgentRuntimeInfo cancelRuntimeInfo() { AgentRuntimeInfo agentRuntimeInfo = new AgentRuntimeInfo(agentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false); agentRuntimeInfo.busy(defaultBuildingInfo); agentRuntimeInfo.cancel(); return agentRuntimeInfo; }
@Test public void shouldUpdateBuildingInfoWhenAgentIsBuilding() throws Exception { AgentInstance agentInstance = AgentInstance.createFromConfig(agentConfig, systemEnvironment, mock(AgentStatusChangeListener.class)); AgentRuntimeInfo agentRuntimeInfo = new AgentRuntimeInfo(agentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false); AgentBuildingInfo buildingInfo = new AgentBuildingInfo("running pipeline/stage/build", "buildLocator"); agentRuntimeInfo.busy(buildingInfo); agentInstance.update(agentRuntimeInfo); assertThat(agentInstance.getBuildingInfo(), is(buildingInfo)); }
public static AgentInstance building(String buildLocator, SystemEnvironment systemEnvironment) { AgentConfig buildingAgentConfig = new AgentConfig("uuid3", "CCeDev01", "10.18.5.1", new ResourceConfigs("java")); AgentRuntimeInfo agentRuntimeInfo = new AgentRuntimeInfo(buildingAgentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false); agentRuntimeInfo.busy(new AgentBuildingInfo("pipeline", buildLocator)); AgentInstance building = AgentInstance.createFromConfig(buildingAgentConfig, systemEnvironment, mock(AgentStatusChangeListener.class)); building.update(agentRuntimeInfo); return building; }
agentRuntimeInfo.busy(new AgentBuildingInfo("build1ForDisplay", "build1"));
@Override public void doWork(EnvironmentVariableContext environmentVariableContext, AgentWorkContext agentWorkContext) { cancelLatch = new CountDownLatch(1); agentWorkContext.getAgentRuntimeInfo().busy(new AgentBuildingInfo("sleepwork", "sleepwork1")); boolean canceled = false; DefaultGoPublisher goPublisher = new DefaultGoPublisher(agentWorkContext.getArtifactsManipulator(), new JobIdentifier(), agentWorkContext.getRepositoryRemote(), agentWorkContext.getAgentRuntimeInfo(), "utf-8"); try { if (this.sleepInMilliSeconds > 0) { canceled = cancelLatch.await(this.sleepInMilliSeconds, TimeUnit.MILLISECONDS); } String result = canceled ? "done_canceled" : "done"; agentWorkContext.getArtifactsManipulator().setProperty(null, new Property(name + "_result", result)); SystemEnvironment systemEnvironment = new SystemEnvironment(); if (systemEnvironment.isConsoleLogsThroughWebsocketEnabled() && systemEnvironment.isWebsocketsForAgentsEnabled()) { goPublisher.consumeLine(format("Sleeping for %s milliseconds", this.sleepInMilliSeconds)); } } catch (InterruptedException e) { throw new RuntimeException(e); } }
agentRuntimeInfo.busy(new AgentBuildingInfo("build1ForDisplay", "build1"));
agentRuntimeInfo.busy(new AgentBuildingInfo("build1ForDisplay", "build1")); agentRuntimeInfo.cancel();
private void initialize(AgentWorkContext agentWorkContext) { JobIdentifier jobIdentifier = assignment.getJobIdentifier(); this.timeProvider = new TimeProvider(); agentWorkContext.getAgentRuntimeInfo().busy(new AgentBuildingInfo(jobIdentifier.buildLocatorForDisplay(), jobIdentifier.buildLocator())); this.workingDirectory = assignment.getWorkingDirectory(); this.materialRevisions = assignment.materialRevisions(); this.goPublisher = new DefaultGoPublisher(agentWorkContext.getArtifactsManipulator(), jobIdentifier, agentWorkContext.getRepositoryRemote(), agentWorkContext.getAgentRuntimeInfo(), consoleLogCharset); this.artifactsPublisher = new ArtifactsPublisher(goPublisher, agentWorkContext.getArtifactExtension(), assignment.getArtifactStores(), agentWorkContext.getPluginRequestProcessorRegistry(), workingDirectory); this.builders = new Builders(assignment.getBuilders(), goPublisher, agentWorkContext.getTaskExtension(), agentWorkContext.getArtifactExtension(), agentWorkContext.getPluginRequestProcessorRegistry()); }
getAgentRuntimeInfo().idle(); try { getAgentRuntimeInfo().busy(new AgentBuildingInfo(buildSettings.getBuildLocatorForDisplay(), buildSettings.getBuildLocator())); build.build(buildSettings.getBuildCommand()); } finally {