Jenkins Build step 'Execute shell' marked build as failure


问题出现:

Jenkins一直都构建成功,今天突然报错:Jenkins Build step 'Execute shell' marked build as failure

 

问题原因:

By default Jenkins take /bin/sh -xe and this means -x will print each and every command.And the other option -e, which causes shell to stop running a script immediately when any command exits with non-zero (when any command fails) exit code.

 

解决办法:

通过问题原因基本确定是因为-e或者-x导致构建失败(我这边是因为-x导致磁盘空间不足),所以我们在"Execute shell"的开头加上"#!/bin/sh" 或"#!/bin/bash"就可以了。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM