jenkins之获取最后一次构建结果
获取最后一次构建的构建结果:curlhttp://10.0.40.245:8000/job/$JOB_NAME/lastBuild/api/xml --user USER:TOKEN#!/bin/bash#author:chunk#通过判断上一次是否构建成功,如果失败则自动清理maven缓存#rm-rf/var/lib/jenkins/.m2/repos...
·
获取最后一次构建的构建结果:
curl http://10.0.40.245:8000/job/$JOB_NAME/lastBuild/api/xml --user USER:TOKEN
#!/bin/bash # author: chunk #通过判断上一次是否构建成功,如果失败则自动清理maven缓存 #rm -rf /var/lib/jenkins/.m2/repository/m2c/ curl http://10.0.40.245:8000/job/$JOB_NAME/lastBuild/api/xml |grep "<building>ture</building>" if [ $? -eq 0 ]; then echo "last build is ok" else rm -rf $JENKINS_HOME/.m2/repository/* echo "clean maven cache is ok" return 0 fi
转载于:https://blog.51cto.com/yanconggod/1982733
更多推荐
已为社区贡献1条内容
所有评论(0)