jenkins 重置 buildid
item = Jenkins.instance.getItemByFullName("spm2.5e_APP_pipeline") item.builds.each() { build -> build.delete() } item.updateNextBuildNumber(1)
判读Jenkins build是否成功,借助把debug console输出到log.txt,然后去判断关键字”OK“ 来决定是否需要后续任务
sudo rm log.txt
./test.sh 2>&1 | tee -a log.txt
sleep 5
if [ $(grep -c "OK" log.txt) == "1" ]
then
echo "Build Succeed......"
else
echo "Failed build exit......"
exit 1
fi