Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
use prebuilt repo
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe committed Oct 10, 2023
1 parent 05c836e commit 9f7b042
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions features/ostreeRepo/image.ostreeRepo.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,26 @@ tar xf "$rootfs" -C "$rootfs_work"
mv "$rootfs_work"/etc "$rootfs_work"/usr/etc

mkdir -p $OSTREE_REPO
ostree init --mode=archive --repo=$OSTREE_REPO
ostree admin init-fs --modern $OSTREE_SYSROOT
ostree admin os-init --sysroot=$OSTREE_SYSROOT debian
ostree config --repo=$OSTREE_REPO set sysroot.bootloader none
ostree commit --repo=$OSTREE_REPO --branch $OSTREE_REF --skip-if-unchanged -s "Debian testing build $(date --utc +%Y-%m-%dT%H:%M:%S%Z)" "$rootfs_work"
ostree remote --repo=$OSTREE_REPO add --no-gpg-verify --no-sign-verify origin http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH $OSTREE_REF

if curl --head --silent --fail http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz 2> /dev/null;
then
echo "Using http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz"
mkdir -p $OSTREE_REPO
download="$(mktemp -d)"
pushd $download
curl --remote-name http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz
tar xf debian-testing-$BUILDER_ARCH.tar.gz --directory $OSTREE_REPO
popd
rm -rf $download
else
echo "Coud not download http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz, building new repo"
ostree init --mode=archive --repo=$OSTREE_REPO
ostree admin init-fs --modern $OSTREE_SYSROOT
ostree admin os-init --sysroot=$OSTREE_SYSROOT debian
ostree config --repo=$OSTREE_REPO set sysroot.bootloader none
ostree remote --repo=$OSTREE_REPO add --no-gpg-verify --no-sign-verify origin http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH $OSTREE_REF
fi

ostree commit --repo=$OSTREE_REPO --branch $OSTREE_REF --skip-if-unchanged -s "Debian testing build $(date --utc +%Y-%m-%dT%H:%M%Z)" "$rootfs_work"

tar --directory $OSTREE_REPO --create --mtime="@$BUILDER_TIMESTAMP" --sort name --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime . | gzip > "$output"

0 comments on commit 9f7b042

Please sign in to comment.