java - How to use Jenkins parameterized builds? -


jenkins allows parameterize builds, can't figure out how make use of it:

enter image description here

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?

  1. 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 of jar (to override default).
  2. 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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -