通过xml路径从jenkins rest api获取构建结果
当我访问http://jenkins-url/job/argus_deploy_service/27/api/xml/?xpath=/freeStyleBuild/result,我成功了 有没有办法让我直接获得成功?我试过xpath=/freeStyleBuild/result/text和xpath=/freeStyleBuild/result/value,但都没有成功。你试过文本吗 由于1.5.x版的安全原因,文本函数在Jenkins中。 您可以使用sed获取内容,例如:通过xml路径从jenkins rest api获取构建结果,jenkins,xpath,Jenkins,Xpath,当我访问http://jenkins-url/job/argus_deploy_service/27/api/xml/?xpath=/freeStyleBuild/result,我成功了 有没有办法让我直接获得成功?我试过xpath=/freeStyleBuild/result/text和xpath=/freeStyleBuild/result/value,但都没有成功。你试过文本吗 由于1.5.x版的安全原因,文本函数在Jenkins中。 您可以使用sed获取内容,例如: curl http:
curl http://jenkins-url/job/argus_deploy_service/27/api/xml/?xpath=/freeStyleBuild/result | sed -r 's/<[^>]+>//g'
curl http://jenkins-url/job/argus_deploy_service/27/api/xml/?xpath=/freeStyleBuild/result | sed -r 's/<[^>]+>//g'