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

ci(docs): Fail when build aborts from broken links #2266

Merged

Conversation

polarathene
Copy link
Member

Description

This is a change originally from @NorseGaud in his PR commit here. To ease review of that PR I'm pulling out anything that doesn't need to be in it.


Using set -ex will exit the script as soon as a non-zero exit code is returned, such as when the docker image fails building the docs due to build --strict catching broken links. This also removes the need for || exit when changing directory.

This seems fine for a small script, but AFAIK an alternative fix is just adding || exit to the end of the docker run command too? There appears to be advice against adopting -e carelessly, while others encourage -e. I know that several maintainers here have preference towards set -e so I've kept the original PR solution.

Additionally:

  • -x is used to improve command visibility when reviewing the workflow log output.
  • --name isn't necessary, but was part of the original PR.
  • I've chosen not to include -o pipefail, only because no pipes are used in this script.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Using `set -ex` will exit the script as soon as a non-zero exit code is returned, such as when the docker image fails building the docs due to `build --strict` catching broken links.

This removes the need for `|| exit`. `-x` is used to improve command visibility in the workflow log output.

`--name` isn't necessary, but was part of the original PR. I've chosen not to include `-o pipefail` only because no pipes are used in the present script.
Extra documentation context for maintainers to quickly grok what's going on.
casperklein
casperklein previously approved these changes Oct 30, 2021
@wernerfred wernerfred mentioned this pull request Oct 30, 2021
7 tasks
Added from their related PR by request.
@github-actions
Copy link
Contributor

Documentation preview for this PR is ready! 🎉

Built with commit: 2ab1cae

@NorseGaud
Copy link
Member

❤️

@polarathene polarathene merged commit fb72f3a into docker-mailserver:master Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants