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

Handle individual failed kernel builds
pull/575/head
Luchesar ILIEV 2 weeks 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: permissions:
contents: write contents: write
env:
RELEASE_NAME: experimental
jobs: jobs:
release: release:
name: Release name: Release
@ -33,12 +36,12 @@ jobs:
env: env:
GPG_KEY_DATA: "${{ secrets.GPG_KEY_DATA }}" GPG_KEY_DATA: "${{ secrets.GPG_KEY_DATA }}"
GPG_KEY_ID: "${{ vars.GPG_KEY_ID }}" 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 - name: Release mainline
uses: ncipollo/release-action@v1.14.0 uses: ncipollo/release-action@v1.14.0
with: with:
name: experimental name: ${{ env.RELEASE_NAME }}
tag: experimental tag: ${{ env.RELEASE_NAME }}
commit: ${{ github.sha }} commit: ${{ github.sha }}
artifacts: ./repo/* artifacts: ./repo/*
allowUpdates: true allowUpdates: true
@ -48,5 +51,5 @@ jobs:
removeArtifacts: true removeArtifacts: true
- uses: rickstaa/action-create-tag@v1.7.2 - uses: rickstaa/action-create-tag@v1.7.2
with: with:
tag: experimental tag: ${{ env.RELEASE_NAME }}
force_push_tag: true force_push_tag: true

@ -12,26 +12,75 @@ fi
# Only set -x here so we can't accidently print the GPG key up there # Only set -x here so we can't accidently print the GPG key up there
set -x 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 sudo chown -R buildbot:buildbot /src
cd /src cd /src
sed -i "/^THREADS=/s/9/$(nproc)/" ~/.config/clean-chroot-manager.conf sed -i "/^THREADS=/s/9/$(nproc)/" ~/.config/clean-chroot-manager.conf
sudo ccm64 d || true sudo ccm64 d || true
sudo bash build.sh -d -u all update sudo bash build.sh -s -d -u all update
build() { 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"
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"
build std # If BASE is us, that means we should have built this package
build lts # so copy it from releases
build hardened if [[ "${pkgbase}" == "${failed_pkg}" ]]; then
build zen 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 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 # Not implemented, yet, as documented in archzfs-ci
# sudo bash test.sh ... # sudo bash test.sh ...

Loading…
Cancel
Save