Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit on fail in azure multiline script #3280

Conversation

stanislavlevin
Copy link
Contributor

By default, the last exit code returned from Azure script will be
checked and, if non-zero, treated as a step failure. Luckily,
for Linux script is a shortcut for Bash. Hence errexit/e option
could be applied. But Azure pipelines doesn't set it by default:
microsoft/azure-pipelines-agent#1803

For multiline script this is a problem unless otherwise designed.
Some of the benefits of checking the result of each subcommand:

  • preventing subsequent issues (broken packages, container images, etc.)
  • time saving (next steps will not run)
  • good diagnostics (tells which part of the script fails)

By default, the `last` exit code returned from Azure script will be
checked and, if non-zero, treated as a step failure.  Luckily,
for Linux script is a shortcut for Bash. Hence errexit/e option
could be applied. But Azure pipelines doesn't set it by default:
microsoft/azure-pipelines-agent#1803

For multiline script this is a problem, unless otherwise designed.
Some of benefits of checking the result of each subcommand:
- preventing subsequent issues (broken packages, container images, etc.)
- time saving (next steps will not run)
- good diagnostics (tells which part of script fails)

Signed-off-by: Stanislav Levin <slev@altlinux.org>
@abbra abbra added ack Pull Request approved, can be merged ipa-next Mark as master (4.12) only re-run Trigger a new run of PR-CI labels Jun 26, 2019
@abbra
Copy link
Contributor

abbra commented Jun 26, 2019

LGTM.

@abbra
Copy link
Contributor

abbra commented Jun 26, 2019

Let us run full test too.

@freeipa-pr-ci freeipa-pr-ci removed the re-run Trigger a new run of PR-CI label Jun 26, 2019
@abbra
Copy link
Contributor

abbra commented Jun 26, 2019

master:

  • b5bb436 Exit on fail in azure multiline script

@abbra abbra added the pushed Pull Request has already been pushed label Jun 26, 2019
@abbra abbra closed this Jun 26, 2019
@stanislavlevin
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged ipa-next Mark as master (4.12) only pushed Pull Request has already been pushed
Projects
None yet
3 participants