I have a problem when run my pipeline, I send notifications to users when <span>$BITBUCKET_EXIT_CODE</span> is 1 but It return 2 as value, on doc is only write 0 for success and 1 for error but 2 is not defined
<span>$BITBUCKET_EXIT_CODE</span>
Hi @Adrian Garay
The BITBUCKET_EXIT_CODE variable will save exit code of the last command run by the pipelines script section (After scripts now available for Bitbucket Pipelines).Let's suppose we have the following bitbucket-pipelines.yml file:
- step: script: - not_existing_command after-script: - echo $BITBUCKET_EXIT_CODE
The script section will try to run the not_existing_command in the terminal and the terminal will return the error 127 (command not found).The error code will have the context of the command that was run. Keep in mind that some commands may have slightly different exit codes, so the values you see in BITBUCKET_EXIT_CODE need to be interpreted based on the command returning the exit code.
I hope that helps =]
Thanks a lot Daniel
You are welcome @Adrian Garay!
It looks like you're new here. Sign in or register to get started.