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

feita há 4 anos3095 visualizações
2 Respostas
0
Resposta aceita

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.

respondido há 4 anos
0

Thanks, worked perfect.

respondido há 4 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas