diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index 2d5ae3ce76f..b628efcb8af 100755 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -162,10 +162,11 @@ in_podman() { local envfile=$(mktemp -p '' in_podman_env_tmp_XXXXXXXX) trap "rm -f $envfile" EXIT + # TODO: This env. var. processing is fugly and fragile. Refactor + # this closer to how podman CI does it using passthrough_envars() msg "Gathering env. vars. to pass-through into container." for envname in $(awk 'BEGIN{for(v in ENVIRON) print v}' | sort | \ - egrep "$envrx" | egrep -v "$SECRET_ENV_RE" | \ - egrep -v "^CIRRUS_.+(MESSAGE|TITLE)") + egrep "$envrx" | egrep -v "$SECRET_ENV_RE"); do envval="${!envname}" [[ -n $(tr -d "$xchars" <<<"$envval") ]] || continue diff --git a/contrib/cirrus/setup.sh b/contrib/cirrus/setup.sh index 8979658458d..404419628a3 100755 --- a/contrib/cirrus/setup.sh +++ b/contrib/cirrus/setup.sh @@ -8,7 +8,7 @@ set -e # expectation mismatch. source $(dirname $0)/lib.sh -req_env_vars OS_RELEASE_ID OS_RELEASE_VER GOSRC IN_PODMAN_IMAGE +req_env_vars OS_RELEASE_ID OS_RELEASE_VER GOSRC IN_PODMAN_IMAGE CIRRUS_CHANGE_TITLE msg "Disabling git repository owner-check system-wide." # Newer versions of git bark if repo. files are unexpectedly owned. @@ -16,6 +16,21 @@ msg "Disabling git repository owner-check system-wide." # the testing environment is disposable, so we don't care.= git config --system --add safe.directory $GOSRC +# Support optional/draft testing using latest/greatest +# podman-next COPR packages. This requires a draft PR +# to ensure changes also pass CI w/o package updates. +if [[ "$OS_RELEASE_ID" =~ "fedora" ]] && \ + [[ "$CIRRUS_CHANGE_TITLE" =~ CI:NEXT ]] +then + # shellcheck disable=SC2154 + if [[ "$CIRRUS_PR_DRAFT" != "true" ]]; then + die "Magic 'CI:NEXT' string can only be used on DRAFT PRs" + fi + + showrun dnf copr enable rhcontainerbot/podman-next -y + showrun dnf upgrade -y +fi + msg "Setting up $OS_RELEASE_ID $OS_RELEASE_VER" cd $GOSRC case "$OS_RELEASE_ID" in