Hi,
I am currently trying to implement a pipeline. But I check,I struggle to find a way to run a step of my pipeline on condition
definitions:
steps:
- step:
name: Run Test
size: 2x # Double the memory allocation
script:
- apk add --no-cache python3 py3-pip python3-dev gcc musl-dev linux-headers curl
- python3 -m venv venv
- source venv/bin/activate
- step:
name: Deploy
size: 2x # Double the memory allocation
script:
- echo "test"
- step:
name: Rollback
script:
- echo "Start rollback"
Could you plase help me find the best approach to run Step rollback only in condition that Step Deploy fails
Thank you
You could possibly use after-script for this? Another option, if you require separated steps, would be to store the result of the deploy in a variable and share with the rollback step.
You might also find BCLOUD-20833 relevant to you.
I do not believe bitbucket supports a "Run on failure" condition. You might need to combine the deploy and rollback logic within the same step? For example, you can run a deploy script and then check the scripts exit code.
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.