Search in sources :

Example 6 with Revision

use of com.thoughtworks.go.domain.materials.Revision in project gocd by gocd.

the class TFSMaterialUpdaterTest method mockRevisionContext.

public void mockRevisionContext() {
    String mockRevision = "11111";
    Revision revision = mock(Revision.class);
    when(revision.getRevision()).thenReturn(mockRevision);
    revisionContext = mock(RevisionContext.class);
    when(revisionContext.getLatestRevision()).thenReturn(revision);
}
Also used : Revision(com.thoughtworks.go.domain.materials.Revision) RevisionContext(com.thoughtworks.go.domain.materials.RevisionContext)

Example 7 with Revision

use of com.thoughtworks.go.domain.materials.Revision in project gocd by gocd.

the class PipelineInstanceModel method hasNewRevisions.

public boolean hasNewRevisions(MaterialConfig materialConfig) {
    Revision currentRevision = getCurrentRevision(materialConfig);
    Revision revision = getLatestRevision(materialConfig);
    return !currentRevision.equals(revision);
}
Also used : Revision(com.thoughtworks.go.domain.materials.Revision)

Example 8 with Revision

use of com.thoughtworks.go.domain.materials.Revision in project gocd by gocd.

the class HgMaterialUpdater method updateTo.

public BuildCommand updateTo(String baseDir, RevisionContext revisionContext) {
    Revision revision = revisionContext.getLatestRevision();
    String workingDir = material.workingdir(new File(baseDir)).getPath();
    UrlArgument url = material.getUrlArgument();
    return compose(secret(url.forCommandline(), url.forDisplay()), echoWithPrefix("Start updating %s at revision %s from %s", material.updatingTarget(), revision.getRevision(), url.forDisplay()), cloneIfNeeded(workingDir), pull(workingDir), update(workingDir, revision), echoWithPrefix("Done.\n"));
}
Also used : HgUrlArgument(com.thoughtworks.go.util.command.HgUrlArgument) UrlArgument(com.thoughtworks.go.util.command.UrlArgument) Revision(com.thoughtworks.go.domain.materials.Revision) File(java.io.File)

Example 9 with Revision

use of com.thoughtworks.go.domain.materials.Revision in project gocd by gocd.

the class TfsMaterialUpdater method updateTo.

public BuildCommand updateTo(String baseDir, RevisionContext revisionContext) {
    Revision revision = revisionContext.getLatestRevision();
    String workingDir = material.workingdir(new File(baseDir)).getPath();
    return compose(secret(material.getPassword()), execTfsCheckout(material, revision, workingDir));
}
Also used : Revision(com.thoughtworks.go.domain.materials.Revision) File(java.io.File)

Example 10 with Revision

use of com.thoughtworks.go.domain.materials.Revision in project gocd by gocd.

the class GitMaterialUpdater method updateTo.

public BuildCommand updateTo(String baseDir, RevisionContext revisionContext) {
    Revision revision = revisionContext.getLatestRevision();
    String workingDir = material.workingdir(new File(baseDir)).getPath();
    UrlArgument url = material.getUrlArgument();
    return compose(echoWithPrefix("Start updating %s at revision %s from %s", material.updatingTarget(), revision.getRevision(), url.forDisplay()), secret(url.forCommandline(), url.forDisplay()), cloneIfNeeded(workingDir, revisionContext.numberOfModifications() + 1), fetchRemote(workingDir), unshallowIfNeeded(workingDir, revision, new Integer[] { GitMaterial.UNSHALLOW_TRYOUT_STEP, Integer.MAX_VALUE }), resetWorkingCopy(workingDir, revision), echoWithPrefix("Done.\n"));
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) Revision(com.thoughtworks.go.domain.materials.Revision) File(java.io.File)

Aggregations

Revision (com.thoughtworks.go.domain.materials.Revision)10 File (java.io.File)6 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)3 Material (com.thoughtworks.go.domain.materials.Material)3 UrlArgument (com.thoughtworks.go.util.command.UrlArgument)3 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 Materials (com.thoughtworks.go.config.materials.Materials)1 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)1 ModificationVisitorAdapter (com.thoughtworks.go.domain.ModificationVisitorAdapter)1 Modification (com.thoughtworks.go.domain.materials.Modification)1 RevisionContext (com.thoughtworks.go.domain.materials.RevisionContext)1 HgUrlArgument (com.thoughtworks.go.util.command.HgUrlArgument)1 InMemoryStreamConsumer (com.thoughtworks.go.util.command.InMemoryStreamConsumer)1