Merge pull request #2455 from cgwalters/packit

Attempt to update packit flow to build in COPR
This commit is contained in:
Luca Bruno 2021-10-15 07:47:28 +00:00 committed by GitHub
commit ec8cf31e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 21 deletions

View File

@ -1,14 +1,24 @@
# build into f34-coreos-continuous on every commit to main
jobs:
- job: production_build
- job: copr_build
trigger: commit
metadata:
branch: main
targets: f34-coreos-continuous
branch: main
owner: "@CoreOS"
project: continuous
targets:
- centos-stream-8-aarch64
- centos-stream-8-x86_64
- fedora-all-aarch64
- fedora-all-s390x
- fedora-all
specfile_path: ostree.spec
actions:
create-archive:
- "./ci/make-git-snapshot.sh"
- "bash -c 'ls ostree-*.tar'"
# https://packit.dev/faq/#how-can-i-download-rpm-spec-file-if-it-is-not-part-of-upstream-repository
post-upstream-clone:
- "wget https://src.fedoraproject.org/rpms/ostree/raw/rawhide/f/ostree.spec"
- "curl -LO https://src.fedoraproject.org/rpms/ostree/raw/rawhide/f/ostree.spec"
# we don't want any downstream patches
- "sed -ie 's/^Patch/# Patch/g' ostree.spec"

View File

@ -1,31 +1,23 @@
#!/bin/sh
#!/bin/bash
set -xeuo pipefail
srcdir=$1
shift
PKG_VER=$1
shift
GITREV=$1
shift
TOP=$(git rev-parse --show-toplevel)
GITREV=$(git rev-parse HEAD)
gitdescribe=$(git describe --always --tags $GITREV)
version=$(echo "$gitdescribe" | sed -e 's,-,\.,g' -e 's,^v,,')
name=$(basename $(pwd))
PKG_VER="${name}-${version}"
TARFILE=${PKG_VER}.tar
TARFILE_TMP=${TARFILE}.tmp
set -x
set -e
test -n "${srcdir}"
test -n "${PKG_VER}"
test -n "${GITREV}"
TOP=$(git rev-parse --show-toplevel)
echo "Archiving ${PKG_VER} at ${GITREV} to ${TARFILE_TMP}"
(cd ${TOP}; git archive --format=tar --prefix=${PKG_VER}/ ${GITREV}) > ${TARFILE_TMP}
ls -al ${TARFILE_TMP}
(cd ${TOP}; git submodule status) | while read line; do
rev=$(echo ${line} | cut -f 1 -d ' '); path=$(echo ${line} | cut -f 2 -d ' ')
echo "Archiving ${path} at ${rev}"
(cd ${srcdir}/${path}; git archive --format=tar --prefix=${PKG_VER}/${path}/ ${rev}) > submodule.tar
(cd ${TOP}/${path}; git archive --format=tar --prefix=${PKG_VER}/${path}/ ${rev}) > submodule.tar
tar -A -f ${TARFILE_TMP} submodule.tar
rm submodule.tar
done