How can a Jenkins user authentication details be “passed” to a script which uses Jenkins API to create jobs?

前端 未结 7 666
别跟我提以往
别跟我提以往 2020-12-02 08:24

I have a script that delete and re-create jobs through curl HTTP-calls and I want to get rid of any hard-coded \"username:password\". E.g. curl -X POST $url --user use

7条回答
  •  臣服心动
    2020-12-02 09:13

    This worked for me:

    curl -u $username:$api_token -FSubmit=Build 'http:///job//buildWithParameters?environment='
    

    API token can be obtained from Jenkins user configuration.

提交回复
热议问题