forked from containers/podman
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI:BUILD] Podman FCOS image from main
Fixes: containers#19446, containers#19447, containers#19448 [NO NEW TESTS NEEDED] Signed-off-by: Lokesh Mandvekar <[email protected]>
- Loading branch information
Showing
3 changed files
with
76 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,34 @@ | ||
name: FCOS Build from ${{ env.COPR_OWNER }}/${{ env.COPR_PROJECT }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
COPR_OWNER: "rhcontainerbot" | ||
COPR_PROJECT: "podman-next" | ||
|
||
jobs: | ||
wait-for-task: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up wait-for-copr | ||
run: | | ||
pip3 install git+https://github.com/packit/wait-for-copr.git@main | ||
- name: Wait for ${{ env.COPR_OWNER }}/${{ env.COPR_PROJECT }} build | ||
run: | | ||
# wait-for-copr attempts 180 tries with 10s between each try by default | ||
wait-for-copr --owner ${{ env.COPR_OWNER }} --project ${{ env.COPR_PROJECT }} podman `git rev-parse --short HEAD` | ||
echo "COPR build ready!" | ||
- name: Build FCOS image | ||
run: | | ||
git clone https://github.com/coreos/layering-examples | ||
cd layering-examples/podman-next | ||
podman build . |
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script handles any custom processing of the spec file using the `fix-spec-file` | ||
# action in .packit.yaml. | ||
|
||
set -eox pipefail | ||
|
||
PACKAGE=podman | ||
|
||
# Set path to rpm spec file | ||
SPEC_FILE=rpm/$PACKAGE.spec | ||
|
||
# Get Version from HEAD | ||
VERSION=$(grep '^const RawVersion' version/rawversion/version.go | cut -d\" -f2) | ||
|
||
# RPM Version can't take "-" | ||
RPM_VERSION=$(echo $VERSION | sed -e 's/-/~/') | ||
|
||
# Generate source tarball from HEAD | ||
git-archive-all -C $(git rev-parse --show-toplevel) --prefix=$PACKAGE-$VERSION/ rpm/$PACKAGE-$VERSION.tar.gz | ||
|
||
# RPM Spec modifications | ||
|
||
# Use the Version from HEAD in rpm spec | ||
sed -i "s/^Version:.*/Version: $RPM_VERSION/" $SPEC_FILE | ||
|
||
# Use Packit's supplied variable in the Release field in rpm spec. | ||
sed -i "s/^Release:.*/Release: $PACKIT_RPMSPEC_RELEASE%{?dist}/" $SPEC_FILE | ||
|
||
# Ensure last part of the release string is the git shortcommit without a | ||
# prepended "g" | ||
sed -i "/^Release: $PACKIT_RPMSPEC_RELEASE%{?dist}/ s/\(.*\)g/\1/" $SPEC_FILE | ||
|
||
# Use above generated tarball as Source in rpm spec | ||
sed -i "s/^Source0:.*.tar.gz/Source0: $PACKAGE-$VERSION.tar.gz/" $SPEC_FILE | ||
|
||
# Update setup macro to use the correct build dir | ||
sed -i "s/^%autosetup.*/%autosetup -Sgit -n %{name}-$VERSION/" $SPEC_FILE |
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