Start Jenkins build using batch script

后端 未结 6 1995
挽巷
挽巷 2020-12-15 23:43

I am working with a Jenkins build server to run synthesis/simulation for FPGAs. Right now I have nightly builds and can start the build manually in Jenkins browser interface

6条回答
  •  盖世英雄少女心
    2020-12-16 00:10

    Here is an example with a curl command (for a job with parameters):

    curl -X POST -u YOUR_USER:YOUR_USER_PASSWORD http://YOUR_JENKINS_URL/job/YOUR_JOB/buildWithParameters?PARAM1=value1&PARAM2=value
    

    And a job without parameters:

    curl -X POST -u YOUR_USER:YOUR_USER_PASSWORD http://YOUR_JENKINS_URL/job/YOUR_JOB/build
    

    If you don't want to use your user/password, you can generate an API token for your Jenkins user:

    And use this token in your curl command:

    curl -X POST http://YOUR_JENKINS_URL/job/YOUR_JOB/build?TOKEN=YOUR_API_TOKEN
    

提交回复
热议问题