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