I've contacted atlassian support and they confirm it's a bug - stages should be independent. They are investigating this problem.
Why bamboo stops build if one stage failed?
-
28-06-2022 - |
سؤال
I have 3 bamboo stages: testing, staging and production. All of them extract the sources, compile and run tests. In previous version of Bamboo it continued the next stage if one failed (one of test failed f.e.). In the latest version it does not go to the next stage and stops build. How can i override this behaviour in order to continue build even if one stage failed?
Output:
simple 17-Sep-2013 17:56:12 Failing task since return code of [c:\dev\maven3\bin\mvn.bat --batch-mode -Djava.io.tmpdir=C:\Program Files\Bamboo\temp\CS-AND-JOB1 clean install -P envbuild -DbuildNumber=4] was 1 while expected 0
simple 17-Sep-2013 17:56:12 Parsing test results...
simple 17-Sep-2013 17:56:12 Finished task 'Maven 3.x'
simple 17-Sep-2013 17:56:12 Running post build plugin 'NCover Results Collector'
simple 17-Sep-2013 17:56:12 Running post build plugin 'Clover Results Collector'
simple 17-Sep-2013 17:56:12 Running post build plugin 'Artifact Copier'
simple 17-Sep-2013 17:56:12 Finalising the build...
simple 17-Sep-2013 17:56:12 Stopping timer.
simple 17-Sep-2013 17:56:12 Build CS-AND-JOB1-4 completed.
المحلول 2
نصائح أخرى
In short, you can't override this behaviour, this is how Bamboo (and other build tools) are designed to work.
What you should be doing is:
- Build once and save the output as an artifact which can be used by later stages
- Test your build output by retrieving the artifact from the first stage
- Deploy to X environment
You shouldn't be deploying to an environment if any of the preceding steps have failed, the point of a failing stage is to indicate something is not right, you should either fix broken tests or exclude them.