diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-08-29 14:14:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 14:14:58 -0400 |
commit | 468aa6478c73e4acd8708ce8bb0bb5a056f329c2 (patch) | |
tree | 0d971c3793eb77572fe4bfd4dc8dce115e39339b | |
parent | 00b03db6f208614d7967f5dbd5c0281cc0bd6d23 (diff) | |
parent | 167b026e7de9892046371fbfcd614b092097b55f (diff) | |
download | podman-468aa6478c73e4acd8708ce8bb0bb5a056f329c2.tar.gz podman-468aa6478c73e4acd8708ce8bb0bb5a056f329c2.tar.bz2 podman-468aa6478c73e4acd8708ce8bb0bb5a056f329c2.zip |
Merge pull request #15457 from lsm5/packit-fix-spec-file-action
[CI:BUILD] Packit: Re-introduce packit with fix-spec-file action
-rw-r--r-- | .cirrus.yml | 2 | ||||
-rw-r--r-- | .packit.sh | 27 | ||||
-rw-r--r-- | .packit.yaml | 20 |
3 files changed, 48 insertions, 1 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index 7da409ffb..628b74f72 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -431,7 +431,7 @@ alt_build_task: - env: ALT_NAME: 'Build Without CGO' - env: - ALT_NAME: 'Test build RPM' + ALT_NAME: 'Test build podman-next Copr RPM' - env: ALT_NAME: 'Alt Arch. Cross' # This task cannot make use of the shared repo.tbz artifact. diff --git a/.packit.sh b/.packit.sh new file mode 100644 index 000000000..7b404598a --- /dev/null +++ b/.packit.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Packit's default fix-spec-file often doesn't fetch version string correctly. +# This script handles any custom processing of the dist-git spec file and gets used by the +# fix-spec-file action in .packit.yaml + +set -eo pipefail + +# Get Version from HEAD +HEAD_VERSION=$(grep 'var Version = semver.MustParse' version/version.go | cut -d\" -f2 | sed -e 's/-/~/') + +# Generate source tarball +git archive --prefix=podman-$HEAD_VERSION/ -o podman-$HEAD_VERSION.tar.gz HEAD + +# RPM Spec modifications + +# Fix Version +sed -i "s/^Version:.*/Version: $HEAD_VERSION/" podman.spec + +# Fix Release +sed -i "s/^Release: %autorelease/Release: $PACKIT_RPMSPEC_RELEASE%{?dist}/" podman.spec + +# Fix Source0 +sed -i "s/^Source0:.*.tar.gz/Source0: %{name}-$HEAD_VERSION.tar.gz/" podman.spec + +# Fix autosetup +sed -i "s/^%autosetup.*/%autosetup -Sgit -n %{name}-$HEAD_VERSION/" podman.spec diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 000000000..ab284b2d5 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,20 @@ +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +upstream_package_name: podman +downstream_package_name: podman + +actions: + post-upstream-clone: + - "curl -O https://src.fedoraproject.org/rpms/podman/raw/main/f/podman.spec" + fix-spec-file: + - bash .packit.sh + +jobs: + - job: production_build + trigger: pull_request + targets: &production_dist_targets + - fedora-36 + - fedora-37 + - fedora-rawhide + scratch: true |