aboutsummaryrefslogtreecommitdiff
path: root/contrib/cirrus
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2022-05-31 11:48:46 -0400
committerChris Evich <cevich@redhat.com>2022-06-01 17:42:11 -0400
commit3fa09e9dba1710f97dbe0f2062685d06fb2fb243 (patch)
tree2980cf8485c015f89a69b6871094077870bec457 /contrib/cirrus
parent2c63b8a2fdbc1e72711e09417380fd67063b07d3 (diff)
downloadpodman-3fa09e9dba1710f97dbe0f2062685d06fb2fb243.tar.gz
podman-3fa09e9dba1710f97dbe0f2062685d06fb2fb243.tar.bz2
podman-3fa09e9dba1710f97dbe0f2062685d06fb2fb243.zip
Makefile: Handle unexpected empty var. values
Fixes #14021 Substitution values built from `$(shell ...)` output can easily be empty due to the shell's default `pipefail` behavior. This can also hide non-zero exit codes, similarly resulting in empty values being set. While not a perfect fix, the situation is improved by using the `err_if_empty` function in all cases where empty values would be unexpected. Remove the definitions for `GIT_BRANCH` and `GIT_BRANCH_CLEAN` which don't seem to actually be used anywhere (including in code). Add a simple release-test to verify `podman info` outputs a non-empty value for "GitCommit". Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus')
-rwxr-xr-xcontrib/cirrus/runner.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh
index c871f1f54..b9f43f395 100755
--- a/contrib/cirrus/runner.sh
+++ b/contrib/cirrus/runner.sh
@@ -312,6 +312,11 @@ function _run_release() {
if [[ -n "$dev" ]]; then
die "Releases must never contain '-dev' in output of 'podman info' ($dev)"
fi
+
+ commit=$(bin/podman info --format='{{.Version.GitCommit}}' | tr -d '[:space:]')
+ if [[ -z "$commit" ]]; then
+ die "Releases must contain a non-empty Version.GitCommit in 'podman info'"
+ fi
msg "All OK"
}