use of org.jfrog.build.extractor.ci.Artifact in project build-info by JFrogDev.
the class GoPublish method createAndDeployZip.
private void createAndDeployZip(ArtifactoryManager artifactoryManager) throws Exception {
// First, we create a temporary zip file of all project files.
File tmpZipFile = archiveProjectDir();
// Second, filter the raw zip file according to Go rules and create deployable zip can be later resolved.
// We use the same code as Artifactory when he resolve a Go module directly from Github.
File deployableZipFile = File.createTempFile(LOCAL_PKG_FILENAME, PKG_ZIP_FILE_EXTENSION, path.toFile());
try (GoZipBallStreamer pkgArchiver = new GoZipBallStreamer(new ZipFile(tmpZipFile), moduleName, version, logger)) {
pkgArchiver.writeDeployableZip(deployableZipFile);
Artifact deployedPackage = deploy(artifactoryManager, deployableZipFile, PKG_ZIP_FILE_EXTENSION);
artifactList.add(deployedPackage);
} finally {
Files.deleteIfExists(tmpZipFile.toPath());
Files.deleteIfExists(deployableZipFile.toPath());
}
}
use of org.jfrog.build.extractor.ci.Artifact in project build-info by JFrogDev.
the class GoPublish method deployGoMod.
private void deployGoMod(ArtifactoryManager artifactoryManager) throws Exception {
String modLocalPath = getModFilePath();
Artifact deployedMod = deploy(artifactoryManager, new File(modLocalPath), PKG_MOD_FILE_EXTENSION);
artifactList.add(deployedMod);
}
use of org.jfrog.build.extractor.ci.Artifact in project build-info by JFrogDev.
the class DockerExtractorTest method pushAndValidateImage.
private void pushAndValidateImage(DockerPush dockerPush, String repo, String imageTag, String shortImageTag) {
BuildInfo buildInfo = dockerPush.execute();
Module module = getAndValidateModule(buildInfo, SHORT_IMAGE_NAME + ":" + shortImageTag, repo);
List<Artifact> artifacts = module.getArtifacts();
validateImageArtifacts(artifacts, imageTag);
assertEquals(7, artifacts.size());
module.getArtifacts().forEach(artifact -> assertEquals(artifact.getRemotePath(), SHORT_IMAGE_NAME + "/" + shortImageTag));
assertEquals(5, module.getDependencies().size());
}
use of org.jfrog.build.extractor.ci.Artifact in project build-info by JFrogDev.
the class NpmPublish method createBuild.
private BuildInfo createBuild() {
String moduleID = StringUtils.isNotBlank(module) ? module : npmPackageInfo.toString();
List<Artifact> artifactList = Collections.singletonList(deployedArtifact);
Module module = new ModuleBuilder().type(ModuleType.NPM).id(moduleID).repository(repo).artifacts(artifactList).build();
List<Module> modules = Collections.singletonList(module);
BuildInfo buildInfo = new BuildInfo();
buildInfo.setModules(modules);
return buildInfo;
}
use of org.jfrog.build.extractor.ci.Artifact in project build-info by JFrogDev.
the class ArtifactBuilder method build.
/**
* Assembles the artifact class
*
* @return Assembled dependency
*/
public Artifact build() {
if (StringUtils.isBlank(name)) {
throw new IllegalArgumentException("Artifact must have a name");
}
Artifact artifact = new Artifact();
artifact.setName(name);
artifact.setType(type);
artifact.setSha1(sha1);
artifact.setSha256(sha256);
artifact.setMd5(md5);
artifact.setRemotePath(remotePath);
artifact.setLocalPath(localPath);
artifact.setProperties(properties);
return artifact;
}
Aggregations