-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JENKINS-30077 - Expand build parameters #31
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
import hudson.model.Run; | ||
import hudson.model.TaskListener; | ||
import hudson.slaves.EnvironmentVariablesNodeProperty; | ||
import hudson.EnvVars; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
@@ -47,6 +48,17 @@ | |
TaskListener listener, | ||
Run<?, ?> build | ||
) { | ||
try { | ||
EnvVars vars = build.getEnvironment(listener); | ||
|
||
for (int i = 0; i < patterns.size(); i++) { | ||
patterns.set(i, new Pattern(vars.expand(patterns.get(i).getPattern()), patterns.get(i).getType())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thx, will take a look. |
||
} | ||
externalDelete = vars.expand(externalDelete); | ||
} catch (Exception e) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What failures do we expect here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was to satisfy an error that was thrown when using |
||
e.printStackTrace(listener.getLogger()); | ||
} | ||
|
||
boolean wipeout = (patterns == null || patterns.isEmpty()) | ||
&& (externalDelete == null || externalDelete.isEmpty()) | ||
; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patterns
can benull
here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh! Good point.