Skip to content

Commit 02f38f3

Browse files
authored
Save late deploy artifacts properties (#596)
1 parent 148d45b commit 02f38f3

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

build-info-client/src/main/java/org/jfrog/build/client/DeployableArtifactDetail.java

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package org.jfrog.build.client;
22

3+
import com.google.common.collect.ArrayListMultimap;
4+
35
import java.io.Serializable;
6+
import java.util.Collection;
7+
import java.util.Map;
48

59
/**
610
* Created by yahavi on 08/05/2017.
@@ -31,13 +35,19 @@ public class DeployableArtifactDetail implements Serializable {
3135
*/
3236
private String targetRepository;
3337

34-
public DeployableArtifactDetail(String artifactSource, String artifactDest, String sha1, String sha256, Boolean deploySucceeded, String targetRepository) {
38+
/**
39+
* Properties to attach to the deployed file as matrix params.
40+
*/
41+
private Map<String, Collection<String>> properties;
42+
43+
public DeployableArtifactDetail(String artifactSource, String artifactDest, String sha1, String sha256, Boolean deploySucceeded, String targetRepository, Map<String, Collection<String>> properties) {
3544
this.sourcePath = artifactSource;
3645
this.artifactDest = artifactDest;
3746
this.sha1 = sha1;
3847
this.sha256 = sha256;
3948
this.deploySucceeded = deploySucceeded;
4049
this.targetRepository = targetRepository;
50+
this.properties = properties;
4151
}
4252

4353
public DeployableArtifactDetail() {
@@ -66,4 +76,8 @@ public String getTargetRepository() {
6676
public Boolean isDeploySucceeded() {
6777
return deploySucceeded;
6878
}
79+
80+
public Map<String, Collection<String>> getProperties() {
81+
return properties;
82+
}
6983
}

build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/deploy/DeployableArtifactsUtils.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ private static Map<String, List<DeployableArtifactDetail>> loadBackwardCompatibl
8787
private static List<DeployableArtifactDetail> getDeployableArtifactsPaths(Set<DeployDetails> deployDetails) {
8888
List<DeployableArtifactDetail> deployableArtifacts = new ArrayList<>();
8989
for (DeployDetails artifact : deployDetails) {
90-
deployableArtifacts.add(new DeployableArtifactDetail(artifact.getFile().getAbsolutePath(), artifact.getArtifactPath(), artifact.getSha1(), artifact.getSha256(), artifact.getDeploySucceeded(), artifact.getTargetRepository()));
90+
Map<String, Collection<String>> artifactProps = artifact.getProperties() != null ? artifact.getProperties().asMap() : Collections.emptyMap();
91+
deployableArtifacts.add(new DeployableArtifactDetail(artifact.getFile().getAbsolutePath(), artifact.getArtifactPath(), artifact.getSha1(), artifact.getSha256(), artifact.getDeploySucceeded(), artifact.getTargetRepository(), artifactProps));
9192
}
9293
return deployableArtifacts;
9394
}

0 commit comments

Comments
 (0)