Skip to content

Commit

Permalink
feature(cf): pass execution ID and trigger to server group creation (#…
Browse files Browse the repository at this point in the history
…2939)

This will be used to provide a link from the server group back to a pipeline that created it, and allow an alternate way to provide build info in some cases.
  • Loading branch information
claymccoy authored and Jon Schneider committed May 28, 2019
1 parent c14a58e commit 23ae955
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.common.collect.ImmutableMap;
import com.netflix.spinnaker.kork.artifacts.model.Artifact;
import com.netflix.spinnaker.orca.clouddriver.tasks.servergroup.ServerGroupCreator;
import com.netflix.spinnaker.orca.pipeline.model.Execution;
import com.netflix.spinnaker.orca.pipeline.model.Stage;
import com.netflix.spinnaker.orca.pipeline.util.ArtifactResolver;
import java.util.*;
Expand All @@ -42,12 +43,15 @@ class CloudFoundryServerGroupCreator implements ServerGroupCreator {
@Override
public List<Map> getOperations(Stage stage) {
Map<String, Object> context = stage.getContext();
final Execution execution = stage.getExecution();
ImmutableMap.Builder<String, Object> operation =
ImmutableMap.<String, Object>builder()
.put("application", context.get("application"))
.put("credentials", context.get("account"))
.put("startApplication", context.get("startApplication"))
.put("region", context.get("region"))
.put("executionId", execution.getId())
.put("trigger", execution.getTrigger().getOther())
.put(
"applicationArtifact",
applicationArtifact(stage, context.get("applicationArtifact")))
Expand Down

0 comments on commit 23ae955

Please sign in to comment.