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

gefragt vor 4 Jahren3095 Aufrufe
2 Antworten
0
Akzeptierte Antwort

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.

beantwortet vor 4 Jahren
0

Thanks, worked perfect.

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen