Prevent codebuild failure based on certain exit codes

0

Hi

I have a command in my buildspec.yaml under build phase that returns different exit codes based on certain conditions. My understanding is that codebuild will fail the build for any none 0 exit codes. Is there a way to prevent/override this?

I need to run other commands based on the exit codes.

Thank you in advance

已提问 4 年前3095 查看次数
2 回答
0
已接受的回答

Depending on what you're trying to run, you may be able to do something like this:

some-command-here; EXITCODE=$?

You can then evaluate $EXITCODE to determine your next steps.
Note that this requires a buildspec.yml version 0.2 or higher.

已回答 4 年前
0

Thanks, worked perfect.

已回答 4 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则