Merge pull request #566 from archzfs/mark/build-failover

Handle individual failed kernel builds
pull/575/head
Luchesar ILIEV 1 week ago committed by GitHub
commit 50de2205a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      .github/workflows/release.yml
  2. 63
      build-container/entrypoint.sh

@ -18,6 +18,9 @@ concurrency:
permissions:
contents: write
env:
RELEASE_NAME: experimental
jobs:
release:
name: Release
@ -33,12 +36,12 @@ jobs:
env:
GPG_KEY_DATA: "${{ secrets.GPG_KEY_DATA }}"
GPG_KEY_ID: "${{ vars.GPG_KEY_ID }}"
run: docker run -e GPG_KEY_DATA -e GPG_KEY_ID --privileged --rm -v "$(pwd):/src" archzfs-builder
run: docker run -e GPG_KEY_DATA -e GPG_KEY_ID -e RELEASE_NAME --privileged --rm -v "$(pwd):/src" archzfs-builder
- name: Release mainline
uses: ncipollo/release-action@v1.14.0
with:
name: experimental
tag: experimental
name: ${{ env.RELEASE_NAME }}
tag: ${{ env.RELEASE_NAME }}
commit: ${{ github.sha }}
artifacts: ./repo/*
allowUpdates: true
@ -48,5 +51,5 @@ jobs:
removeArtifacts: true
- uses: rickstaa/action-create-tag@v1.7.2
with:
tag: experimental
tag: ${{ env.RELEASE_NAME }}
force_push_tag: true

@ -12,26 +12,75 @@ fi
# Only set -x here so we can't accidently print the GPG key up there
set -x
FAILOVER_REPO_DIR=""
FAILOVER_BASE_URL=""
if [ ! -z "${RELEASE_TYPE}" ]; then
FAILOVER_REPO_DIR="$(mktemp -d)"
cd "${FAILOVER_REPO_DIR}"
FAILOVER_BASE_URL="https://github.com/archzfs/archzfs/releases/download/${RELEASE_TYPE}"
curl -sL "${FAILOVER_BASE_URL}/archzfs.db.tar.xz" | tar xvJ
fi
sudo chown -R buildbot:buildbot /src
cd /src
sed -i "/^THREADS=/s/9/$(nproc)/" ~/.config/clean-chroot-manager.conf
sudo ccm64 d || true
sudo bash build.sh -d -u all update
sudo bash build.sh -s -d -u all update
build() {
sudo bash build.sh -d "$1" make
sudo bash build.sh -s -d "$1" make
}
build utils
failover() {
if [ -z "${FAILOVER_REPO_DIR}" ]; then
echo "No failover repo available, failing because of: $1"
exit 1
fi
failed_pkg="$1"
build std
build lts
build hardened
build zen
set +x # This gets way to verbose
for desc in "${FAILOVER_REPO_DIR}"/*/desc; do
# Iterate lines
pkgbase=""
pkgfile=""
while read -r line; do
case "$line" in
%FILENAME%)
read -r pkgfile
;;
%BASE%)
read -r pkgbase
;;
esac
done < "$desc"
# If BASE is us, that means we should have built this package
# so copy it from releases
if [[ "${pkgbase}" == "${failed_pkg}" ]]; then
set -x
tmp_file="$(mktemp)"
curl -o "${tmp_file}" -L "${FAILOVER_BASE_URL}/${pkgfile}"
sudo mv "${tmp_file}" "/scratch/.buildroot/root/repo/${pkgfile}"
set +x
fi
done
set -x
}
# These packages must always build
build utils
build dkms
# These are kernel dependant, so they might fail
build lts || failover zfs-linux-lts
build std || failover zfs-linux
build hardened || failover zfs-linux-hardened
build zen || failover zfs-linux-zen
# Not implemented, yet, as documented in archzfs-ci
# sudo bash test.sh ...

Loading…
Cancel
Save