Search in sources :

Example 16 with ArtifactoryManager

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 "";
    }
}
Also used : ArtifactoryManager(org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager) BuildInfo(org.jfrog.build.extractor.ci.BuildInfo) Vcs(org.jfrog.build.extractor.ci.Vcs)

Example 17 with ArtifactoryManager

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);
}
Also used : ArtifactoryManager(org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager)

Example 18 with ArtifactoryManager

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);
    }
}
Also used : NpmProject(org.jfrog.build.extractor.npm.types.NpmProject) ArtifactoryManager(org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager)

Example 19 with ArtifactoryManager

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);
    }
}
Also used : ArtifactoryManager(org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager) IOException(java.io.IOException)

Example 20 with ArtifactoryManager

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;
}
Also used : ArtifactoryManager(org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager)

Aggregations

ArtifactoryManager (org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager)21 IOException (java.io.IOException)11 File (java.io.File)3 ArtifactoryClientConfiguration (org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration)3 DeployDetails (org.jfrog.build.extractor.clientConfiguration.deploy.DeployDetails)3 ModuleBuilder (org.jfrog.build.extractor.builder.ModuleBuilder)2 BuildInfo (org.jfrog.build.extractor.ci.BuildInfo)2 IncludeExcludePatterns (org.jfrog.build.extractor.clientConfiguration.IncludeExcludePatterns)2 ConsumerRunnableBase (org.jfrog.build.extractor.producerConsumer.ConsumerRunnableBase)2 ProducerConsumerExecutor (org.jfrog.build.extractor.producerConsumer.ProducerConsumerExecutor)2 ProducerRunnableBase (org.jfrog.build.extractor.producerConsumer.ProducerRunnableBase)2 Serializable (java.io.Serializable)1 java.util (java.util)1 Date (java.util.Date)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 StringUtils (org.apache.commons.lang3.StringUtils)1 Pair (org.apache.commons.lang3.tuple.Pair)1 Header (org.apache.http.Header)1