From 3db591736f79906a31536f6a6ee59a04ff2f0c69 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sat, 12 Dec 2020 21:25:01 +0100 Subject: [PATCH] system-maintenance: Download workstation OSTree repo from GitHub The repo is now being built automatically by a GitHub action: https://github.com/martinpitt/ostree-pitti-workstation/actions Also move from a persistent to a temporary remote, to reduce the assumptions on the already installed system. --- system-maintenance | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/system-maintenance b/system-maintenance index 886d184..3235aa2 100755 --- a/system-maintenance +++ b/system-maintenance @@ -6,14 +6,23 @@ rpm-ostree cleanup --repomd rpm-ostree cleanup --pending rpm-ostree cleanup --base -# keep repo on tmpfs -REPO=/var/tmp/repo/ -mkdir -p $REPO -mount -t tmpfs tmpfs $REPO +# download latest repo build +REPO=$(mktemp -d -t repo.XXXXXX) +trap "rm -rf '$REPO'" EXIT INT QUIT PIPE +CURL="curl -u token:$(cat ~martin/.config/github-token) --show-error --fail" +RESPONSE=$($CURL --silent https://api.github.com/repos/martinpitt/ostree-pitti-workstation/actions/artifacts) +ZIP=$(echo "$RESPONSE" | jq --raw-output '.artifacts | map(select(.name == "repository"))[0].archive_download_url') +echo "INFO: Downloading $ZIP ..." +[ -e /tmp/repository.zip ] || $CURL -L -o /tmp/repository.zip "$ZIP" +rm -rf "$REPO" +mkdir -p "$REPO" +unzip -p /tmp/repository.zip | tar -xzC "$REPO" +rm /tmp/repository.zip -(cd ~martin/src/workstation-ostree-config/; ./compose.sh) -rpm-ostree upgrade -umount $REPO +# upgrade +ostree remote add --no-gpg-verify tmp-local "file://$REPO" +rpm-ostree rebase tmp-local: +ostree remote delete tmp-local # fix fonts between Fedora releases rm -rf ~martin/.cache/fontconfig -- 2.39.2