I am using build pipelines and release pipelines to manage AWS infrastructure.
The build pipeline runs tests on the code to ensure the code meets certain standards.
The release pipeline spins up a temporary environment and runs integration tests.
I want to configure the release pipeline so that if the integration tests fail, it marks the particular build it used as failed. So that if someone were to trigger the release pipeline again, it would use the most recent successful build, not the one it just used.
I've tried to achieve this by adding a tag to the build run at the build run state, either of "succeeded" if the build pipeline tests or "failed" if the build pipeline fails.
Then the release pipeline is configured to use the artifact from the latest build which is marked as "succeeded".
The intention was that if the integration tests in the release pipeline fail, there is a step which removes the "succeeded" tag from the that build run and replaces it with "failed".
However, I can't find a way of automatically changing those tags as part of the release pipeline. Is there a way? Am I approaching this from the wrong angle?
I have a build pipeline that tags the run as "succeeded" if tests are passed, and "failed" if tests do not pass.
If the build is successful, the release pipeline spins up some infrastructure, deploys the build, and then runs integration tests.
If those tests fail, I'd like the pipeline to remove the "succeeded" tag from the run that it took the artifact from, and to add a "failed" tag.
The only documentation I've found is here, but this looks like it's referring to a different type of tag.
Is there a way of doing it from the release pipeline?