From 1e0084a8926d57f9d0383ca5a453f3c95c699152 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 12 Oct 2023 14:29:05 -0400 Subject: [PATCH] packit/tmt: initial enablement This commit adds a test to vendor HEAD into podman and check if podman builds successfully. Signed-off-by: Lokesh Mandvekar --- .fmf/version | 1 + .packit.yaml | 34 ++++++++++++++++++++++++++++++++++ plans/main.fmf | 12 ++++++++++++ plans/podman_build.sh | 11 +++++++++++ plans/prepare.sh | 19 +++++++++++++++++++ 5 files changed, 77 insertions(+) create mode 100644 .fmf/version create mode 100644 .packit.yaml create mode 100644 plans/main.fmf create mode 100644 plans/podman_build.sh create mode 100644 plans/prepare.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 000000000..a1ec20671 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,34 @@ +--- +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +jobs: + # All tests specified in the `/plans/` subdir + # Podman build test for Fedora and CentOS Stream + - job: tests + trigger: pull_request + #notifications: + #failure_comment: + # message: "podman e2e tests failed. @containers/packit-build please check." + targets: &pr_test_targets + - fedora-all + - epel-9 + - epel-8 + identifier: podman_build_test + skip_build: true + tmt_plan: "/plans/podman_build_test" + + # Podman build test for RHEL + #- job: tests + # trigger: pull_request + # use_internal_tf: true + # # notifications: + # #failure_comment: + # # message: "podman e2e tests failed on RHEL. @containers/packit-build please check." + # targets: &pr_test_targets_rhel + # epel-9-x86_64: + # distros: [RHEL-9.2.0-Nightly] + # epel-8-x86_64: + # distros: [RHEL-8.10.0-Nightly] + # identifier: podman_e2e_test_internal + # tmt_plan: "/plans/podman_e2e_test" diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 000000000..76abce8e4 --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,12 @@ +prepare: + - how: shell + script: ./plans/prepare.sh + - how: install + package: + - git + +/podman_build_test: + summary: Run Podman build test + execute: + how: tmt + script: ./plans/podman_build.sh diff --git a/plans/podman_build.sh b/plans/podman_build.sh new file mode 100644 index 000000000..5d1627780 --- /dev/null +++ b/plans/podman_build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -eox pipefail + +cat /etc/redhat-release +git clone https://github.com/containers/podman +cd podman +dnf -y builddep rpm/podman.spec +go mod edit -require github.com/containers/common@HEAD +make vendor +make rpm diff --git a/plans/prepare.sh b/plans/prepare.sh new file mode 100644 index 000000000..a7a66c19f --- /dev/null +++ b/plans/prepare.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -eox pipefail + +RHEL_RELEASE=$(rpm --eval %{?rhel}) +ARCH=$(uname -m) + +if [ $RHEL_RELEASE -eq 8 ]; then + dnf -y module disable container-tools +fi +if [ -f /etc/centos-release ]; then + dnf -y install epel-release +elif [ $RHEL_RELEASE -ge 8 ]; then + dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$RHEL_RELEASE.noarch.rpm + dnf config-manager --set-enabled epel + cat /etc/yum.repos.d/epel.repo +fi +dnf -y copr enable rhcontainerbot/podman-next +dnf config-manager --save --setopt="*:rhcontainerbot:podman-next.priority=5"