Jenkins input pipeline step filled via POST with CSRF - howto?

后端 未结 4 1308
陌清茗
陌清茗 2021-01-12 22:13

I have Jenkins pipeline with an Input step, and I would like to submit this input(single string argument) via a script. So far I am trying with curl, ideally I\'ll be sendi

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 22:27

    There is an easier way, simply call the proceedEmpty URL for the jobs:

    curl -X POST -H "Jenkins-Crumb:${JENKINS_CRUMB}" http://${JENKINS_URL}/job/${JOB_NAME}/${BUILD_ID}/input/${INPUT_ID}/proceedEmpty
    

    There is no need to pass in body data.

    To abort, use:

    curl -X POST -H "Jenkins-Crumb:${JENKINS_CRUMB}" http://${JENKINS_URL}/job/${JOB_NAME}/${BUILD_ID}/input/${INPUT_ID}/abort
    

提交回复
热议问题