Skip to content

Commit

Permalink
RESOLVED - issue JENKINS-11512: Cloudformation outputs are not added to
Browse files Browse the repository at this point in the history
the build as environment variables. 
https://issues.jenkins-ci.org/browse/JENKINS-11512
  • Loading branch information
Erick Dovale committed Oct 27, 2011
1 parent e12aaef commit 1ebdea6
Showing 1 changed file with 13 additions and 2 deletions.
Expand Up @@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

import org.kohsuke.stapler.DataBoundConstructor;
Expand All @@ -32,17 +33,27 @@ public class CloudFormationBuildWrapper extends BuildWrapper {

protected List<StackBean> stacks;

private final List<CloudFormation> cloudFormations = new ArrayList<CloudFormation>();

@DataBoundConstructor
public CloudFormationBuildWrapper(List<StackBean> stacks) {
this.stacks = stacks;
}

@Override
public void makeBuildVariables(AbstractBuild build,
Map<String, String> variables) {

for (CloudFormation cf : cloudFormations){
variables.putAll(cf.getOutputs());
}

}

@Override
public Environment setUp(AbstractBuild build, Launcher launcher,
BuildListener listener) throws IOException, InterruptedException {

final List<CloudFormation> cloudFormations = new ArrayList<CloudFormation>();

EnvVars env = build.getEnvironment(listener);
env.overrideAll(build.getBuildVariables());

Expand Down

0 comments on commit 1ebdea6

Please sign in to comment.