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