标签:name lin api line json enc https username reference
使用如下方式可以停掉build job:
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/stop
如下方式停不掉,猜测属于不同的客户端导致crumb token不同:
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/stop
Reference:
https://segmentfault.com/a/1190000010738617
标签:name lin api line json enc https username reference
原文地址:https://www.cnblogs.com/i-shu/p/11493405.html