使用shell脚本在Jenkins中手工构建失败
发布时间:2020-12-15 19:39:13 所属栏目:安全 来源:网络整理
导读:我想标记一个Jenkins构建在一个场景下失败,例如: if [ -f "$file" ]then echo "$file found."else echo "$file not found." #Do Jenkins Build Failfi 是否可以通过Shell脚本? 答:如果我们退出整数1,Jenkins构建将被标记为失败。所以我用exit 1替换了这
我想标记一个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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |