Skip to content

Commit

Permalink
[FIXED JENKINS-39998] replace tokens in pipeline jobs too
Browse files Browse the repository at this point in the history
  • Loading branch information
imod committed Dec 27, 2016
1 parent e6e7d2e commit 222e2df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -98,7 +98,7 @@ public static Map<ManagedFile, FilePath> provisionConfigFiles(List<ManagedFile>

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;
Expand All @@ -119,7 +119,7 @@ public static Map<ManagedFile, FilePath> provisionConfigFiles(List<ManagedFile>

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());
}
Expand Down

0 comments on commit 222e2df

Please sign in to comment.