When Windows Runner fails, it does not have the BITBUCKET_EXIT_CODE variable or any other to use in the after script step. The variable dont have a value, so it is always running the after script step.
- step: &test_after-script_windows
name: echo test windows
runs-on:
- self.hosted
- windows
script:
- echo teste windows
- echo $env:PACKAGE_VERSION
- echo $env:AWS_S3_BUCKET
- awscli run dotnet
after-script:
- echo $LastExitCode
- echo $BITBUCKET_EXIT_CODE
- |
if ($BITBUCKET_EXIT_CODE -ne 1) {
echo "Windows build step failed, running rollback"
} else {
echo "Windows build step succeeded"
}
I was missing the $env when calling the value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.