使用以下方式能夠停掉build job:json
crumb=`curl -X GET http://<ip>:8080/crumbIssuer/api/json --user jenkins:intel@123|grep -Eo 'crumb":".*",' |grep -Eo ':".*?"' | awk -F '"' '{print $2}'`
curl -X POST -u <username>:<password> -H Jenkins-Crumb:$crumb http://<ip>:8080/job/pipline1/9/stopsegmentfault
以下方式停不掉,猜想屬於不一樣的客戶端致使crumb token不一樣:api
crumb=`curl -s http://<ip>:8080/crumbIssuer/api/json|grep -Eo 'crumb":".*",' |grep -Eo ':".*?"' | awk -F '"' '{print $2}'`
curl -X POST -u jenkins:intel@123 -H Jenkins-Crumb:$crumb http://<ip>:8080/job/pipline1/9/stopcurl
Reference:ui