There is some problem in bitbucket pipeline deployment. In case of multiple service deployment in single pipeline, If any specific service build process failed, then it marked the entire pipeline failed and skip the remaining services deployment which was in queue. it becomes very hard to re-initiate deployment for skipped services.
Hello @manish_taazaa ,
Welcome to the community!
The way that pipelines identify if a command was successful or failed is by analyzing the exit code of the command. If a zero exit code is returned by the command you are executing, the command is considered successful, while when a non-zero exit code is returned, the command is considered a failure, the entire pipeline execution is stopped and the step is marked as failed.
If you would like the pipeline step to not stop when a command fails (return a non-zero exit code), you can use the following shell flag :
- step:
script:
- set +e # Do not stop builds at first command failure
- <rest of your commands>
This will change the default shell behavior, making the build not exit when a non-zero exit code is returned by a command, effectively making the Pipeline step not exit when a non-zero exit code is returned. The caveat of this workaround is that every step where you use this flag will always be considered successful, as the exit code will be ignored (see Pipeline builds succeeds even on command failure)
If you would like to still keep track of the failed steps, meaning that you would like to see the step failing in the UI, but the pipelines to proceed to the next steps, we have an open feature request for it, which you can find in the following link :
I would encourage you to Vote and add yourself as a watcher on that feature request, in case it matches the functionality you are looking for. Feel free to leave any comments on your use case on that feature as well, as this helps to give it traction.
Hope that helps! Let me know in case you have any questions.
Thank you, @manish_taazaa !
Patrik S
How to use "allow_failure" in multi-step deployment and how to build all the steps even any one step gives error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @manish_taazaa ,
The "allow_failure" flag is currently not available as this is still a feature request. You can follow the feature request ticket BCLOUD-21670 for any updates in regard to the implementation of that feature.
The workaround would be to make the step always successful, regardless of whether a command fails, by adding the following instruction at all the steps you want to ignore errors in your yml file :
- step:
script:
- set +e # Do not stop build at first command failure
Thank you, @manish_taazaa !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Patrik S The given solution will always show the step as "Success" even if you have failing tests.
I need to report failing tests and should show failed tests on the pipeline.
the step that failed should still show as "Failed" then continue to the next step. please help me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @manish_taazaa ,
Unfortunately, it's currently not possible for the step to fail and continue to the next steps. This is a feature request that is being tracked on BCLOUD-21670.
The only current workaround is to use the set +e flag in your script, but as you mentioned, the downside is that all the steps will show as "Success".
In this case, I would suggest voting and adding yourself as a watcher on BCLOUD-21670 to be informed about any progress on its implementation.
Thank you, @manish_taazaa !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.