Skip to content

Commit

Permalink
Packit: initial enablement
Browse files Browse the repository at this point in the history
This commit will run Copr builds on every PR against all active
releases of Fedora, thus allowing buildability checks before the
PR merges.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
  • Loading branch information
lsm5 committed Jun 29, 2023
1 parent 3c97bcb commit 4489741
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .packit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/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

dnf -y install git-archive-all

# Get Version from HEAD
HEAD_VERSION=$(./build-aux/git-version-gen --prefix "" . | cut -d"-" -f1)

# Generate source tarball
git-archive-all --prefix=crun-$HEAD_VERSION/ --force-submodules crun-$HEAD_VERSION.tar.gz

# RPM Spec modifications

# Fix Version
sed -i "s/^Version:.*/Version: $HEAD_VERSION/" crun.spec

# Fix Release
sed -i "s/^Release:.*/Release: $PACKIT_RPMSPEC_RELEASE%{?dist}/" crun.spec

# Fix Source0
sed -i "s/^Source0:.*/Source0: %{name}-$HEAD_VERSION.tar.gz/" crun.spec

# Fix autosetup
sed -i "s/^%autosetup.*/%autosetup -Sgit -n %{name}-$HEAD_VERSION/" crun.spec
41 changes: 41 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# 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: rpm/crun.spec
upstream_tag_template: v{version}

jobs:
- &copr
job: copr_build
trigger: pull_request
owner: rhcontainerbot
project: packit-builds
enable_net: true
srpm_build_deps:
- make

- <<: *copr
# Run on commit to main branch
trigger: commit
branch: main
project: podman-next

- job: propose_downstream
trigger: release
update_release: false
dist_git_branches:
- fedora-all

- job: koji_build
trigger: commit
dist_git_branches:
- fedora-all

- job: bodhi_update
trigger: commit
dist_git_branches:
- fedora-branched # rawhide updates are created automatically

0 comments on commit 4489741

Please sign in to comment.