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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南