use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentInstanceMother method updateOS.
public static AgentInstance updateOS(AgentInstance agentInstance, String operatingSystem) {
Agent agent = agentInstance.getAgent();
AgentRuntimeInfo newRuntimeInfo = fromServer(agent, true, agentInstance.getLocation(), agentInstance.getUsableSpace(), operatingSystem);
newRuntimeInfo.setStatus(agentInstance.getStatus());
agentInstance.update(newRuntimeInfo);
return agentInstance;
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentInstanceMother method pending.
public static AgentInstance pending(SystemEnvironment systemEnvironment) {
Agent agent = new Agent("uuid4", "CCeDev03", "10.18.5.3", asList("db", "web"));
AgentRuntimeInfo runtimeInfo = fromServer(agent, false, "/var/lib", 0L, "linux");
AgentInstance agentInstance = createFromLiveAgent(runtimeInfo, systemEnvironment, mock(AgentStatusChangeListener.class));
agentInstance.pending();
agentInstance.update(runtimeInfo);
agentInstance.pending();
return agentInstance;
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentInstanceMother method building.
public static AgentInstance building(String buildLocator, SystemEnvironment systemEnvironment) {
Agent buildingAgentConfig = new Agent("uuid3", "CCeDev01", "10.18.5.1", singletonList("java"));
AgentRuntimeInfo agentRuntimeInfo = new AgentRuntimeInfo(buildingAgentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie");
agentRuntimeInfo.busy(new AgentBuildingInfo("pipeline", buildLocator));
AgentInstance building = AgentInstance.createFromAgent(buildingAgentConfig, systemEnvironment, mock(AgentStatusChangeListener.class));
building.update(agentRuntimeInfo);
return building;
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentInstanceMother method updateUsableSpace.
public static AgentInstance updateUsableSpace(AgentInstance agentInstance, Long freespace) {
Agent agent = agentInstance.getAgent();
agentInstance.update(fromServer(agent, true, agentInstance.getLocation(), freespace, "linux"));
return agentInstance;
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentInstanceMother method updateElasticAgentId.
public static AgentInstance updateElasticAgentId(AgentInstance agentInstance, String elasticAgentId) {
Agent agent = agentInstance.getAgent();
agent.setElasticAgentId(elasticAgentId);
agentInstance.syncAgentFrom(agent);
return agentInstance;
}
Aggregations