use of org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager in project build-info by JFrogDev.
the class IssuesCollector method getPreviousVcsRevision.
/**
* Gets the previous vcs revision from the LATEST build published to Artifactory.
*/
private String getPreviousVcsRevision(ArtifactoryManagerBuilder artifactoryManagerBuilder, String prevBuildName, Vcs prevVcs, String project) throws IOException {
try (ArtifactoryManager artifactoryManager = artifactoryManagerBuilder.build()) {
// Get LATEST build info from Artifactory
BuildInfo previousBuildInfo = artifactoryManager.getBuildInfo(prevBuildName, LATEST, project);
if (previousBuildInfo == null) {
return "";
}
// Gets the first revision related to the current git repository.
List<Vcs> vcsList = previousBuildInfo.getVcs();
if (vcsList != null && vcsList.size() > 0) {
for (Vcs curVcs : previousBuildInfo.getVcs()) {
if (StringUtils.isNotEmpty(curVcs.getRevision()) && StringUtils.equals(curVcs.getUrl(), prevVcs.getUrl())) {
return curVcs.getRevision();
}
}
}
return "";
}
}
use of org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager in project build-info by JFrogDev.
the class UsageReporter method reportUsage.
public void reportUsage(String artifactoryUrl, String username, String password, String accessToken, ProxyConfiguration proxyConfiguration, Log log) throws IOException {
ArtifactoryManager artifactoryManager = new ArtifactoryManager(artifactoryUrl, username, password, accessToken, log);
if (proxyConfiguration != null) {
artifactoryManager.setProxyConfiguration(proxyConfiguration);
}
artifactoryManager.reportUsage(this);
}
use of org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager in project build-info by JFrogDev.
the class NpmInstallCi method execute.
@Override
public BuildInfo execute() {
try (ArtifactoryManager artifactoryManager = artifactoryManagerBuilder.build()) {
this.artifactoryManager = artifactoryManager;
validatePath();
validateArtifactoryVersion();
validateNpmVersion();
validateRepoExists(artifactoryManager, repo, "Source repo must be specified");
NpmProject npmProject = new NpmProject(commandArgs, repo, workingDir, isCiCommand);
return buildInfoExtractor.extract(npmProject);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RuntimeException(e);
}
}
use of org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager in project build-info by JFrogDev.
the class GoPublish method execute.
public BuildInfo execute() {
try (ArtifactoryManager artifactoryManager = artifactoryManagerBuilder.build()) {
preparePrerequisites(deploymentRepo, artifactoryManager);
publishPkg(artifactoryManager);
return createBuild();
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RuntimeException(e);
}
}
use of org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager in project build-info by JFrogDev.
the class ArtifactoryManagerBuilder method resolveProperties.
public ArtifactoryManager resolveProperties(ArtifactoryClientConfiguration clientConf) {
ArtifactoryManager artifactoryManager = resolveClientProps(clientConf);
resolveTimeout(clientConf, artifactoryManager);
resolveProxy(clientConf.proxy, artifactoryManager);
resolveRetriesParams(clientConf, artifactoryManager);
resolveInsecureTls(clientConf, artifactoryManager);
return artifactoryManager;
}
Aggregations