Skip to content

Commit

Permalink
Merge pull request #4830 from cevich/ci_next
Browse files Browse the repository at this point in the history
CI: Support testing w/ podman-next COPR packages
  • Loading branch information
rhatdan authored Jun 5, 2023
2 parents df1fb74 + a630e35 commit a9342e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
5 changes: 3 additions & 2 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion contrib/cirrus/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,29 @@ 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.
# This mainly affects rootless and containerized testing. But
# 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
Expand Down

0 comments on commit a9342e3

Please sign in to comment.