summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2021-10-05 15:49:23 -0400
committerColin Walters <walters@verbum.org>2021-10-14 12:36:38 -0400
commit7ba8dbf0ccfc8435414b897e6b10d0d89e0d3494 (patch)
tree2e5ee9f6a07419bd5f4110d9f0690224bf19b31d
parent6b8295ada151a5e18674733bab56946b6d9e7e0f (diff)
downloadostree-7ba8dbf0ccfc8435414b897e6b10d0d89e0d3494.tar.gz
Attempt to update packit flow to build in COPR
No idea if this will really work, but at least `packit srpm` does work now.
-rw-r--r--.packit.yaml18
-rwxr-xr-xci/make-git-snapshot.sh26
2 files changed, 23 insertions, 21 deletions
diff --git a/.packit.yaml b/.packit.yaml
index 857d6ec4..68a1c724 100644
--- a/.packit.yaml
+++ b/.packit.yaml
@@ -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"
diff --git a/ci/make-git-snapshot.sh b/ci/make-git-snapshot.sh
index 1a137bff..67cf14c9 100755
--- a/ci/make-git-snapshot.sh
+++ b/ci/make-git-snapshot.sh
@@ -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