1 ,自动启动jenkins 的job:
启动不带参数的job:
curl --user USER:PASSWORD JENKINS_URL/job/JOBNAME/build
启动带参数的job:
curl --user USER:PASSWORD JENKINS_URL/job/JOBNAME/buildWithParameters
2, 自动disable Project:
curl --user ${UserName}:${PASSWORD} -o /dev/null --data disable JENKINS_URL/job/JOBNAME/disable
3,查询job的状态
curl --silent ${JENKINS_SERVER}/job/JOB_NAME/lastBuild/api/json
4,获取build的num
curl --silent ${JENKINS_SERVER}/job/JOB_NAME/lastBuild/buildNumber
5,获取最近成功的build的num
curl --silent ${JENKINS_SERVER}/job/JOB_NAME/lastStableBuild/buildNumber
直接用shell命令都可以
转载于:https://blog.51cto.com/hsuing/2108062