Skip to content
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

Include defaults in interpolation #50

Merged
merged 1 commit into from
Oct 25, 2018
Merged

Conversation

ronaldvanrij
Copy link

We've had some situations in which we needed to specify defaults and be included in variable interpolation. For example a default could be a parametrized path to certain resources, while the loaded properties file would simply contain the referenced variables, i.e.:

default as hashmap:
[base_path: "/${application}/${environment}/${version}"]

loaded properties file

application=My Application
environment=DEV
version=1.0.0

Current workaround would be to serialize this hashmap into a string and provide this to the readProperties method, but this seems the be a convoluted approach. This tweaks allows you to use the defaults parameter and have those defaults be included into the string interpolation.

@rudolfwalter
Copy link

@rsandell This would be very useful for us as well, could you take a look at this? :)

@rsandell rsandell merged commit f13d847 into jenkinsci:master Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants