Attempt to update packit flow to build in COPR
authorColin Walters <walters@verbum.org>
Tue, 5 Oct 2021 19:49:23 +0000 (15:49 -0400)
committerColin Walters <walters@verbum.org>
Thu, 14 Oct 2021 16:36:38 +0000 (12:36 -0400)
No idea if this will really work, but at least `packit srpm`
does work now.

.packit.yaml
ci/make-git-snapshot.sh

index 857d6ec4b047f37b848215e42f24dd476c8e369a..68a1c724ac0cb4c96614e6079d594b7ba829ca99 100644 (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"
index 1a137bff175a5f5a79e114979cd4b690aa1e5756..67cf14c956e85a6fe0b9e5a1cefc7783246128d4 100755 (executable)
@@ -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