Search in sources :

Example 1 with GitMaterialUpdater

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);
}
Also used : GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) ArrayList(java.util.ArrayList) ScmMaterial(com.thoughtworks.go.config.materials.ScmMaterial) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) ScmMaterial(com.thoughtworks.go.config.materials.ScmMaterial) GitMaterialUpdater(com.thoughtworks.go.domain.materials.git.GitMaterialUpdater) DependencyMaterialRevision(com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision)

Example 2 with GitMaterialUpdater

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));
}
Also used : JobResult(com.thoughtworks.go.domain.JobResult) BuildSession(com.thoughtworks.go.buildsession.BuildSession) GitMaterialUpdater(com.thoughtworks.go.domain.materials.git.GitMaterialUpdater)

Aggregations

GitMaterialUpdater (com.thoughtworks.go.domain.materials.git.GitMaterialUpdater)2 BuildSession (com.thoughtworks.go.buildsession.BuildSession)1 ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)1 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)1 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)1 JobResult (com.thoughtworks.go.domain.JobResult)1 DependencyMaterialRevision (com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision)1 ArrayList (java.util.ArrayList)1