-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI:BUILD] Packit: initial enablement
This commit will run COPR builds on every PR against all active releases of CentOS Stream and Fedora, thus allowing buildability checks before the PR merges. Builds are done on a custom COPR project: `rhcontainerbot/packit-builds`. Ref: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/packit-builds/ The build targets are set in the copr itself, so we don't need to explicitly mention them in `.packit.yaml`, making upstream configuration a lot simpler. The `spec.rpkg` file meant for rpm builds post-pr-merge at `rhcontainerbot/podman-next` copr gets reused for packit builds, so the packit jobs are independent of Fedora / CentOS dist-git. Fixes: #1103 Signed-off-by: Lokesh Mandvekar <[email protected]>
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 '^version' conmon-rs/common/Cargo.toml | cut -d\" -f2 | sed -e 's/-/~/') | ||
|
||
# Generate source tarball from HEAD | ||
git archive --prefix=conmon-rs-$HEAD_VERSION/ -o conmon-rs-$HEAD_VERSION.tar.gz HEAD | ||
|
||
# RPM Spec modifications | ||
|
||
# Update Version in spec with Version from Cargo.toml | ||
sed -i "s/^Version:.*/Version: $HEAD_VERSION/" conmon-rs.spec | ||
|
||
# Update Release in spec with Packit's release envvar | ||
sed -i "s/^Release: %autorelease/Release: $PACKIT_RPMSPEC_RELEASE%{?dist}/" conmon-rs.spec | ||
|
||
# Update Source tarball name in spec | ||
sed -i "s/^Source:.*.tar.gz/Source: %{name}-$HEAD_VERSION.tar.gz/" conmon-rs.spec | ||
|
||
# Update setup macro to use the correct build dir | ||
sed -i "s/^%setup.*/%autosetup -Sgit -n %{name}-$HEAD_VERSION/" conmon-rs.spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
# See the documentation for more information: | ||
# https://packit.dev/docs/configuration/ | ||
|
||
# Build targets can be found at: | ||
# https://copr.fedorainfracloud.org/coprs/rhcontainerbot/packit-builds/ | ||
|
||
specfile_path: conmon-rs.spec | ||
|
||
jobs: | ||
- job: copr_build | ||
trigger: pull_request | ||
owner: rhcontainerbot | ||
project: packit-builds | ||
enable_net: true | ||
srpm_build_deps: | ||
- cargo | ||
- make | ||
- rpkg | ||
actions: | ||
post-upstream-clone: | ||
- "rpkg spec --outdir ./" | ||
fix-spec-file: | ||
- "bash .packit.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters