Jenkins API 实践
获取项目配置
curl -X GET http://admin:Jenkins@127.0.0.1:37555/job/geek-icem_backend_build-packages/config.xml
build
curl -X POST http://admin:Jenkins@127.0.0.1:37555/job/geek-icem_backend_build-packages/build -F ‘json={“parameter”: [{“name”: “Project”, “value”: “geek-icem-gateway”}, {“name”: “Branch”, “value”: “ad”}]}’
curl -X POST http://127.0.0.1:37555/job/geek-icem_backend_build-packages/build –user admin:Jenkins -H ‘cache-control: no-cache’ -F ‘json={“parameter”: [{“name”: “Project”, “value”: “geek-icem-gateway”}, {“name”: “Branch”, “value”: “ad”}]}’
获取构建信息
curl -X GET http://admin:Jenkins@127.0.0.1:37555/job/geek-icem_backend_build-packages/lastCompletedBuild/api/json
获取构建信息
curl -X GET http://admin:Jenkins@127.0.0.1:37555/job/geek-icem_backend_build-packages/lastBuild/api/json
获取控制台日志
curl -X GET http://admin:Jenkins@127.0.0.1:37555/job/geek-icem_backend_build-packages/17/consoleText
获取描述
curl -X GET http://admin:Jenkins@127.0.0.1:37555/job/geek-icem_backend_build-packages/description
References
jenkins 出现“Error 403 No valid crumb was included in the request ”的解决方案