Can Jenkins handle an gui/non-gui interactive python or java program? -
i want create build pipeline, , developers need set few things properties file gets populated using front end end gui.
i tried running sample cli interactive script using python asked name , prints out afterwards, jenkins waited ages hanged. see asked input, there no way user input data.
edit: running jenkins service..or there plugin recommends or way created python script?
preference: prefer utilize python because little lightweight, if people had success other languages can comprise.
using gui menu populate data, cool because can utilize alternative boxes, drop downwards menus , create fancy isn't necessity, cli considerably improve our current deployment.
btw, running on windows 7 laptop running python 2.7 , java 1.7
sorry essay! people can help me!
sorry, jenkins not interactive application. designed automated execution.
the viable way input jenkins job (and executed job) job parameters populated before job started. granted, jenkins gui parameter entry not greatest, job. 1 time jenkins job collected job parameters @ start of job, can pass parameters executes (python, shell, whatever) @ time during job. 2 things have true happen:
you need collect input info before job starts whatever job calls (python, shell, etc) need able receive input not interactively, through command line. how input programa designed script should able take parameters on command line:
./goodscript.sh myname
simplest way of doing it, value myname
stored in $1
first parameter of script. subsequent command line parameters available in variables $2
, $3
, on.
./goodscript.sh -name myname -age 30
improve way of doing it, script can take multiple parameters regardless of order specifying parameter name before parameter value. can read using getopt method of parameter passing
both examples above assume goodscript.sh
written plenty able process command line parameters. if script not explicitly process command line parameters, doing above useless.
you can "pipe" output interactive script not designed handle command line parameters explicitly: echo myname | ./interactivescript.sh
pass value myname
first interactive prompt interactivescript.sh
provides user. problem can pass value first interactive prompt.
like said above, can utilize jenkins gui gather sorts of job parameters (dropdown lists, checkboxes, text entry). assume know how setup jenkins job parameters. if not, in job configuration click "this build parameterized" checkbox. if can't figure out how set up, that's different question , need explained separately.
however, 1 time jenkins job collected parameters front, can reference them in "execute shell" step. if using windows, reference them %param_name%
, , linux $param_name
.
explain need help with: getting script take command line parameters, or passing command line parameters jenkins job gui, , expand reply further
python jenkins jenkins-plugins user-interaction build-pipeline
No comments:
Post a Comment