I was wondering if it's possible to execute a step even if previous step failed.
I know there is something called after-script this can't be used it it needs to execute a defined step.
The purpose is because i need to start an instance run some things on it then shut it down but when it fails on the run part it will not shutdown the instance.
The code:
definitions: steps: - step: &Start_ec2 name: Start ec2 build server image: amazon/aws-cli script: - aws ec2 start-instances --instance-ids id - aws ec2 wait instance-running --instance-ids id
- step: &Stop_ec2 name: Stop ec2 build server image: amazon/aws-cli script: - aws ec2 stop-instances --instance-ids id - aws ec2 wait instance-stopped --instance-ids id
- step: &build name: Build script: - pipe: atlassian/ssh-run:0.2.6 variables: SSH_USER: $SSH_USER SERVER: $SERVER COMMAND: 'echo "hello"'
pipelines: branches: master: - step: *Start_ec2 - step: *build - step: *Stop_ec2