use of com.thoughtworks.go.util.NamedProcessTag in project gocd by gocd.
the class GitRepoContainingSubmodule method createRepo.
private File createRepo(String repoName) throws Exception {
File withSubmodules = new File(workingDir, repoName);
withSubmodules.mkdirs();
git(withSubmodules).init();
createCommandLine("git").withEncoding(UTF_8).withWorkingDir(withSubmodules).withArgs("config", "user.name", "go_test").runOrBomb(true, new NamedProcessTag("git_config"));
createCommandLine("git").withEncoding(UTF_8).withWorkingDir(withSubmodules).withArgs("config", "user.email", "go_test@go_test.me").runOrBomb(true, new NamedProcessTag("git_config"));
createCommandLine("git").withEncoding(UTF_8).withWorkingDir(withSubmodules).withArgs("config", "commit.gpgSign", "false").runOrBomb(true, new NamedProcessTag("git_config"));
String fileName = "file-" + System.currentTimeMillis();
addAndCommitNewFile(withSubmodules, fileName, "Added " + fileName);
fileName = "file-" + System.currentTimeMillis();
addAndCommitNewFile(withSubmodules, fileName, "Added " + fileName);
return withSubmodules;
}
use of com.thoughtworks.go.util.NamedProcessTag in project gocd by gocd.
the class GitTestRepo method cloneBundleToFolder.
private void cloneBundleToFolder(File from, File workingDir) {
GitCommand git = git(workingDir);
InMemoryStreamConsumer outputStreamConsumer = inMemoryConsumer();
int returnValue = git.clone(outputStreamConsumer, from.getAbsolutePath());
if (returnValue != 0) {
throw new RuntimeException(String.format("[ERROR] Failed to clone. URL [%s] exit value [%d] output [%s]", from.getAbsolutePath(), returnValue, outputStreamConsumer.getAllOutput()));
}
createCommandLine("git").withEncoding(UTF_8).withWorkingDir(workingDir).withArgs("config", "user.name", "go_test").runOrBomb(true, new NamedProcessTag("git_config"));
createCommandLine("git").withEncoding(UTF_8).withWorkingDir(workingDir).withArgs("config", "user.email", "go_test@go_test.me").runOrBomb(true, new NamedProcessTag("git_config"));
createCommandLine("git").withEncoding(UTF_8).withWorkingDir(workingDir).withArgs("config", "commit.gpgSign", "false").runOrBomb(true, new NamedProcessTag("git_config"));
git.fetchAndResetToHead(outputStreamConsumer, false);
}
use of com.thoughtworks.go.util.NamedProcessTag in project gocd by gocd.
the class ScmVersionInfoProvider method getHgVersion.
private String getHgVersion() {
try {
CommandLine hg = createCommandLine("hg").withArgs("version").withEncoding(UTF_8);
String hgOut = hg.runOrBomb(new NamedProcessTag("hg version check")).outputAsString();
return hgOut;
} catch (Exception e) {
return null;
}
}
use of com.thoughtworks.go.util.NamedProcessTag in project gocd by gocd.
the class HgCommand method checkConnection.
public void checkConnection(UrlArgument repositoryURL) {
CommandLine hg = createCommandLine("hg").withArgs("id", "--id", "--").withArg(repositoryURL).withNonArgSecrets(secrets).withEncoding(UTF_8);
execute(hg, new NamedProcessTag(repositoryURL.forDisplay()));
}
use of com.thoughtworks.go.util.NamedProcessTag in project gocd by gocd.
the class HgCommand method version.
public HgVersion version() {
CommandLine hg = createCommandLine("hg").withArgs("version").withEncoding(UTF_8);
String hgOut = execute(hg, new NamedProcessTag("hg version check")).outputAsString();
return HgVersion.parse(hgOut);
}
Aggregations