Skip to content

Commit

Permalink
JENKINS-28215
Browse files Browse the repository at this point in the history
Cloning settings to avoid overwriting them with expanded values on build
  • Loading branch information
cast committed May 4, 2015
1 parent 07f2ae4 commit 675c9d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Expand Up @@ -80,11 +80,13 @@ public boolean perform(LambdaVariables lambdaVariables,AbstractBuild<?, ?> build
return true;
}
try {
lambdaVariables.expandVariables(build.getEnvironment(listener));
LambdaUploader lambdaUploader = new LambdaUploader(lambdaVariables, build, listener);
LambdaVariables executionVariables = lambdaVariables.getClone();

executionVariables.expandVariables(build.getEnvironment(listener));
LambdaUploader lambdaUploader = new LambdaUploader(executionVariables, build, listener);

lambdaUploader.upload();
build.addAction(new LambdaProminentAction(lambdaVariables.getFunctionName(), lambdaUploader.getLambdaResultConforms()));
build.addAction(new LambdaProminentAction(executionVariables.getFunctionName(), lambdaUploader.getLambdaResultConforms()));
return true;
} catch (Exception exc) {
throw new RuntimeException(exc);
Expand Down
Expand Up @@ -179,6 +179,10 @@ public void expandVariables(EnvVars env) {
runtime = expand(runtime, env);
}

public LambdaVariables getClone(){
return new LambdaVariables(awsAccessKeyId, awsSecretKey, awsRegion, artifactLocation, description, functionName, handler, memorySize, mode, role, runtime, timeout, successOnly);
}

private String expand(String value, EnvVars env) {
return Util.replaceMacro(value.trim(), env);
}
Expand Down

0 comments on commit 675c9d6

Please sign in to comment.