java - How to use Jenkins parameterized builds? -
jenkins allows parameterize builds, can't figure out how make use of it:
say kick ant build off command-line so:
ant -buildfile /path/to/my/build.xml -dpackagetype=jar package
this invoke build.xml
's package
target, , make property named packagetype
available it, value of jar
.
i'm assuming in screenshot above, name field specify packagetype
, value?
- if jenkins wants me specify default value property, specify value project using? instance, might want default value of
war
, have jenkins job pass in value ofjar
(to override default). - also, jenkins mean "...allows user save typing actual value." user? type value anyways?
thanks in advance!
whenever user configures parameterised build in jenkins, parameter name taken environment variable
the user can make use of such parameters using environment variable.
for example, in case if packagetype parameter want pass,
then specify name packagetype , value war
you can use in script required %packagetype%
(for batch) or $packagetype
(for shell)
after configuring job, whenever click build button, jenkins prompts parameter
when using file parameter, uploaded file placed working directory
Comments
Post a Comment