How to trigger Jenkins builds remotely and to pass parameters

前端 未结 7 1541
傲寒
傲寒 2020-11-27 03:05

I am invoking a Jenkins job remotely using:

wget http://:8080/job/Test-Jenkins/build?token=DOIT

Here Test-Jenkins

7条回答
  •  [愿得一人]
    2020-11-27 03:16

    In your Jenkins job configuration, tick the box named "This build is parameterized", click the "Add Parameter" button and select the "String Parameter" drop down value.

    Now define your parameter - example:

    Now you can use your parameter in your job / build pipeline, example:

    Next to trigger the build with own/custom parameter, invoke the following URL (using either POST or GET):

    http://JENKINS_SERVER_ADDRESS/job/YOUR_JOB_NAME/buildWithParameters?myparam=myparam_value
    

提交回复
热议问题