Reputation: 414
I have a question about build parameters in Jenkins.
I want add build parameter (url) on Jenkins, and write there any URL, and then use it in code.
Is it posible, and if it is, how I can do this?
System.getenv("PARAM_NAME");
isn't working for me.
Thanks a lot =)
Upvotes: 2
Views: 3425
Reputation: 22149
If you are writing java code or jenkins plugin for instance, you can simply do this:
import hudson.model.AbstractProject;
AbstractProject job.getLastBuild().getBuildVariables().containsKey("PARAM_NAME")
Upvotes: 1
Reputation: 7385
I think you are looking for the EnvInject+Plugin.
Some use cases
Upvotes: 0
Reputation: 93728
You could have jenkins modify your values.xml file before compiling. That would be the easiest way I can quickly think of.
Upvotes: 0