Sel*_*amy 51 shell continuous-integration jenkins
我想在一个场景上标记Jenkins构建失败,例如:
if [ -f "$file" ]
then
echo "$file found."
else
echo "$file not found."
#Do Jenkins Build Fail
fi
Run Code Online (Sandbox Code Playgroud)
是否可以通过Shell脚本?
答:如果我们以整数1退出,Jenkins构建将被标记为失败.所以我替换了评论exit 1来解决这个问题.
alk*_*ion 76
您需要做的就是退出1.
if [ -f "$file" ]
then
echo "$file found."
else
echo "$file not found."
exit 1
fi
Run Code Online (Sandbox Code Playgroud)