Skip to content
Permalink
Browse files

[FIXED JENKINS-39998] replace tokens in pipeline jobs too

  • Loading branch information...
imod committed Dec 27, 2016
1 parent e6e7d2e commit 222e2df8d868186577df049afbaeb11b73639328
Showing with 3 additions and 3 deletions.
  1. +1 −1 pom.xml
  2. +2 −2 src/main/java/org/jenkinsci/plugins/configfiles/buildwrapper/ManagedFileUtil.java
@@ -65,7 +65,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>token-macro</artifactId>
<version>1.12.1</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -98,7 +98,7 @@ public static FilePath tempDir(FilePath ws) {

String expandedTargetLocation = managedFile.targetLocation;
try {
expandedTargetLocation = build instanceof AbstractBuild ? TokenMacro.expandAll((AbstractBuild<?, ?>) build, listener, managedFile.targetLocation) : managedFile.targetLocation;
expandedTargetLocation = TokenMacro.expandAll(build, workspace, listener, managedFile.targetLocation);
} catch (MacroEvaluationException e) {
listener.getLogger().println("[ERROR] failed to expand variables in target location '" + managedFile.targetLocation + "' : " + e.getMessage());
expandedTargetLocation = managedFile.targetLocation;
@@ -119,7 +119,7 @@ public static FilePath tempDir(FilePath ws) {

if (managedFile.getReplaceTokens()) {
try {
fileContent = build instanceof AbstractBuild ? TokenMacro.expandAll((AbstractBuild<?, ?>) build, listener, fileContent) : fileContent;
fileContent = TokenMacro.expandAll(build, workspace, listener, fileContent);
} catch (MacroEvaluationException e) {
listener.getLogger().println("[ERROR] failed to expand variables in content of " + configFile.name + " - " + e.getMessage());
}

0 comments on commit 222e2df

Please sign in to comment.
You can’t perform that action at this time.