Skip to content

Commit

Permalink
Save late deploy artifacts properties (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
talarian1 authored Dec 29, 2021
1 parent 148d45b commit 02f38f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.jfrog.build.client;

import com.google.common.collect.ArrayListMultimap;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;

/**
* Created by yahavi on 08/05/2017.
Expand Down Expand Up @@ -31,13 +35,19 @@ public class DeployableArtifactDetail implements Serializable {
*/
private String targetRepository;

public DeployableArtifactDetail(String artifactSource, String artifactDest, String sha1, String sha256, Boolean deploySucceeded, String targetRepository) {
/**
* Properties to attach to the deployed file as matrix params.
*/
private Map<String, Collection<String>> properties;

public DeployableArtifactDetail(String artifactSource, String artifactDest, String sha1, String sha256, Boolean deploySucceeded, String targetRepository, Map<String, Collection<String>> properties) {
this.sourcePath = artifactSource;
this.artifactDest = artifactDest;
this.sha1 = sha1;
this.sha256 = sha256;
this.deploySucceeded = deploySucceeded;
this.targetRepository = targetRepository;
this.properties = properties;
}

public DeployableArtifactDetail() {
Expand Down Expand Up @@ -66,4 +76,8 @@ public String getTargetRepository() {
public Boolean isDeploySucceeded() {
return deploySucceeded;
}

public Map<String, Collection<String>> getProperties() {
return properties;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ private static Map<String, List<DeployableArtifactDetail>> loadBackwardCompatibl
private static List<DeployableArtifactDetail> getDeployableArtifactsPaths(Set<DeployDetails> deployDetails) {
List<DeployableArtifactDetail> deployableArtifacts = new ArrayList<>();
for (DeployDetails artifact : deployDetails) {
deployableArtifacts.add(new DeployableArtifactDetail(artifact.getFile().getAbsolutePath(), artifact.getArtifactPath(), artifact.getSha1(), artifact.getSha256(), artifact.getDeploySucceeded(), artifact.getTargetRepository()));
Map<String, Collection<String>> artifactProps = artifact.getProperties() != null ? artifact.getProperties().asMap() : Collections.emptyMap();
deployableArtifacts.add(new DeployableArtifactDetail(artifact.getFile().getAbsolutePath(), artifact.getArtifactPath(), artifact.getSha1(), artifact.getSha256(), artifact.getDeploySucceeded(), artifact.getTargetRepository(), artifactProps));
}
return deployableArtifacts;
}
Expand Down

0 comments on commit 02f38f3

Please sign in to comment.