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

build.sh: Stop at errors and/or unset parameters #99

Merged

Conversation

joakimr-axis
Copy link
Contributor

@joakimr-axis joakimr-axis commented Jun 13, 2023

Describe your changes

Unless we stop at errors, the script will keep going on with new commands even if the previous ones fail. It should fail early to make the build process more solid and comprehensible.

Also fail at unset parameters, and remove superfluous quotes at variable assignment.

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have verified that the code builds perfectly fine on my local system
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have verified that my code follows the style already available in the repository
  • I have made corresponding changes to the documentation

Unless we stop at errors, the script will keep going on with new
commands even if the previous ones fail. It should fail early to make
the build process more solid and comprehensible.

Also fail at unset parameters, and remove superfluous quotes at variable
assignment.

Change-Id: Id26abd68d51ec6aaeef20779116f375688b98c69
Signed-off-by: Joakim Roubert <[email protected]>
@joakimr-axis joakimr-axis requested a review from a team as a code owner June 13, 2023 14:16
@@ -1,16 +1,16 @@
#!/bin/sh
case "$1" in
#!/bin/sh -eu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get failure on "HTTP_PROXY: unbound variable" when building locally due to the -u flag
Possibly we should remove the proxy build args but either way the -e should be enough I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, my bad. I think keeping the -u but setting ${HTTP_PROXY:-} would be the best way forward. Then we signal that we accept HTTP_PROXY to be empty, but if there are any forgotten variables we will be made aware of it and nothing will go under the radar. I will update.

Copy link
Contributor

@madelen-at-work madelen-at-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix - appart from the -u flag this should be ok to integrate

@madelen-at-work madelen-at-work merged commit f24b4f4 into AxisCommunications:main Sep 13, 2023
madelen-at-work pushed a commit that referenced this pull request Oct 18, 2023
* main:
  Apply clang-format to dockerdwrapper.c
  Bump actions/checkout from 3 to 4
  build.sh: Stop at errors and/or unset parameters (#99)
  Remove build docker hub (#102)
  Fix build for Docker v 20.10.9 (#98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants