use of com.thoughtworks.go.domain.materials.MaterialAgentFactory in project gocd by gocd.
the class BuildWork method prepareJob.
private void prepareJob(AgentIdentifier agentIdentifier, PackageRepositoryExtension packageRepositoryExtension, SCMExtension scmExtension) {
goPublisher.reportAction("Start to prepare");
goPublisher.reportCurrentStatus(Preparing);
createWorkingDirectoryIfNotExist(workingDirectory);
if (!plan.shouldFetchMaterials()) {
goPublisher.consumeLineWithPrefix("Skipping material update since stage is configured not to fetch materials");
return;
}
ProcessOutputStreamConsumer<GoPublisher, GoPublisher> consumer = processOutputStreamConsumer();
MaterialAgentFactory materialAgentFactory = new MaterialAgentFactory(consumer, workingDirectory, agentIdentifier, packageRepositoryExtension, scmExtension);
materialRevisions.getMaterials().cleanUp(workingDirectory, consumer);
goPublisher.consumeLineWithPrefix("Start to update materials.\n");
for (MaterialRevision revision : materialRevisions.getRevisions()) {
materialAgentFactory.createAgent(revision).prepare();
}
}
use of com.thoughtworks.go.domain.materials.MaterialAgentFactory in project gocd by gocd.
the class DependencyMaterialAgentTest method shouldBeCreatedByAgentFactory.
@Test
public void shouldBeCreatedByAgentFactory() {
MaterialAgentFactory factory = new MaterialAgentFactory(ProcessOutputStreamConsumer.inMemoryConsumer(), new File("blah"), new AgentIdentifier("", "", ""), null, null);
MaterialAgent createdAgent = factory.createAgent(materialRevision("pipeline-name", 1, "pipeline-label", "stage-name", 1));
assertThat(createdAgent, instanceOf(DependencyMaterialAgent.class));
}
Aggregations