use of com.thoughtworks.go.domain.materials.git.GitMaterialUpdater in project gocd by gocd.
the class MaterialRevisions method updateToCommand.
public BuildCommand updateToCommand(String baseDir) {
List<BuildCommand> commands = new ArrayList<>();
for (MaterialRevision revision : revisions) {
Material material = revision.getMaterial();
if (material instanceof ScmMaterial) {
if (material instanceof GitMaterial) {
GitMaterialUpdater updater = new GitMaterialUpdater((GitMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else {
commands.add(BuildCommand.fail("%s Material is not supported for new build command agent", material.getTypeForDisplay()));
}
}
}
return BuildCommand.compose(commands);
}
use of com.thoughtworks.go.domain.materials.git.GitMaterialUpdater in project gocd by gocd.
the class GitMaterialUpdaterTest method updateTo.
private void updateTo(GitMaterial material, RevisionContext revisionContext, JobResult expectedResult) {
BuildSession buildSession = newBuildSession();
JobResult result = buildSession.build(new GitMaterialUpdater(material).updateTo("working", revisionContext));
assertThat(buildInfo(), result, is(expectedResult));
}
Aggregations