Skip to content

Commit

Permalink
[FIXED JENKINS-9138] Expand environment variables in fingerprint targ…
Browse files Browse the repository at this point in the history
…ets.
  • Loading branch information
Mike Robinet authored and kohsuke committed Mar 23, 2011
1 parent 99fdf47 commit d6948ec
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions core/src/main/java/hudson/tasks/Fingerprinter.java
Expand Up @@ -24,6 +24,7 @@
package hudson.tasks;

import com.google.common.collect.ImmutableMap;
import hudson.EnvVars;
import hudson.Extension;
import hudson.FilePath;
import hudson.FilePath.FileCallable;
Expand Down Expand Up @@ -102,10 +103,12 @@ public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListene
listener.getLogger().println(Messages.Fingerprinter_Recording());

Map<String,String> record = new HashMap<String,String>();


if(targets.length()!=0)
record(build, listener, record, targets);

EnvVars environment = build.getEnvironment(listener);
if(targets.length()!=0) {
String expandedTargets = environment.expand(targets);
record(build, listener, record, expandedTargets);
}

if(recordBuildArtifacts) {
ArtifactArchiver aa = build.getProject().getPublishersList().get(ArtifactArchiver.class);
Expand All @@ -115,7 +118,8 @@ public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListene
build.setResult(Result.FAILURE);
return true;
}
record(build, listener, record, aa.getArtifacts() );
String expandedArtifacts = environment.expand(aa.getArtifacts());
record(build, listener, record, expandedArtifacts);
}

build.getActions().add(new FingerprintAction(build,record));
Expand Down

0 comments on commit d6948ec

Please sign in to comment.