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);
}
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);
}
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"));
}
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));
}
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"));
}
Aggregations