Fix update container image script#196
Conversation
The script for updating the Buildbarn container image versions relied on dummy dependencies, which were removed in #195. This commit makes the script read from MODULE.bazel to determine the image versions instead.
9029736 to
c53c0a7
Compare
| "https://api.github.com/repos/buildbarn/$repo/commits/$hash_full") | ||
| exit_code=$? | ||
| if [[ "$exit_code" != 0 ]]; then | ||
| echo >&2 "Failed to fetch https://api.github.com/repos/buildbarn/$repo/commits/$hash_full" |
There was a problem hiding this comment.
Do we want to duplicate the url in the error message?
Could you extract it to a variable instead?
Is this because Curl does not print an error message with --silent? Generally this adds code that I'd prefer to not need. A simple set -e -o pipefail and have the subcommands print their errors.
Then we enrich with extra information, but this does not seem very extra.
There was a problem hiding this comment.
A variable would make sense, yes.
During testing I could not get the program to exit on curl error for whatever reason, hence the manual exit code check. set -e -o pipefail is already present. I'm probably missing something, would you mind taking a quick look?
| # The date separates the day and the time segment with a "T" | ||
| # and appends "Z". | ||
| # The image versions are constructed using `MODULE.bazel` and Github. | ||
| # The first seven characters from the commit hash in `MODULE.bazel` |
There was a problem hiding this comment.
Why do we only use the first seven? If the module file has the full hash?
There was a problem hiding this comment.
I'm not sure what you mean. This refers specifically to the construction of the image version, which consists of the first seven commit hash characters + the timestamp, the latter being retrieved from Github using the full hash.
The script for updating the Buildbarn container image versions relied on dummy dependencies, which were removed in #195. This commit makes the script read from MODULE.bazel to determine the image versions instead.