Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过xml路径从jenkins rest api获取构建结果_Jenkins_Xpath - Fatal编程技术网

通过xml路径从jenkins rest api获取构建结果

通过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:

当我访问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://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'