Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Update remote urls
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe committed Oct 17, 2023
1 parent e6fc709 commit 074cbaa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
14 changes: 8 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ set -u
set -o pipefail

platforms=("metal" "kvm")
architectures=("amd64" "arm64")
architectures=("arm64")

pushd gardenlinux

for platform in "${platforms[@]}"
do
for architecture in "${architectures[@]}"
do
./build ${platform}_dev_curl-ostreeRepo-${architecture}
done
done
popd




podp
pushd debian
for architecture in "${architectures[@]}"
do
./build ostreeRepo-${architecture}
done
popd
18 changes: 11 additions & 7 deletions debian/features/ostreeRepo/image.ostreeRepo.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ OSTREE_SYSROOT="$MYROOT/sysroot"
OSTREE_REPO=$OSTREE_SYSROOT/ostree/repo
OSTREE_REF="debian/testing/$BUILDER_ARCH"

REMOTE_NAME="$BUILDER_CNAME".ostreeRepo
REMOTE_ARCHIVE_NAME="$REMOTE_NAME.tar.gz"
REMOTE_URL="http://ostree.gardenlinux.io"

rootfs="$1"
output="$2"

Expand All @@ -23,26 +27,26 @@ mv "$rootfs_work"/etc "$rootfs_work"/usr/etc

mkdir -p $OSTREE_REPO

if curl --head --silent --fail http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz 2> /dev/null;
if curl --head --silent --fail $REMOTE_URL/$REMOTE_ARCHIVE_NAME 2> /dev/null;
then
echo "Using http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz"
echo "Using $REMOTE_URL/$REMOTE_ARCHIVE_NAME"
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
curl --remote-name $REMOTE_URL/$REMOTE_ARCHIVE_NAME
tar xf $REMOTE_ARCHIVE_NAME --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"
echo "Coud not download $REMOTE_URL/$REMOTE_ARCHIVE_NAME, 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
ostree remote --repo=$OSTREE_REPO add --no-gpg-verify --no-sign-verify origin $REMOTE_URL/$REMOTE_NAME $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"
ostree commit --repo=$OSTREE_REPO --branch $OSTREE_REF --skip-if-unchanged -s "Debian $REMOTE_NAME $(date --utc +%Y-%m-%dT%H:%M%Z)" "$rootfs_work"

ostree log --repo=$OSTREE_REPO $OSTREE_REF

Expand Down
10 changes: 8 additions & 2 deletions gardenlinux/features/ostreeRepo/image.ostreeRepo.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OSTREE_SYSROOT="$MYROOT/sysroot"
OSTREE_REPO=$OSTREE_SYSROOT/ostree/repo
OSTREE_REF="gardenlinux/today/$BUILDER_ARCH"

REMOTE_NAME="gardenlinux-$BUILDER_CNAME"
REMOTE_NAME="$BUILDER_CNAME".ostreeRepo
REMOTE_ARCHIVE_NAME="$REMOTE_NAME.tar.gz"
REMOTE_URL="http://ostree.gardenlinux.io"

Expand Down Expand Up @@ -46,6 +46,12 @@ if curl --head --silent --fail $REMOTE_URL/$REMOTE_ARCHIVE_NAME 2> /dev/null;
ostree remote --repo=$OSTREE_REPO add --no-gpg-verify --no-sign-verify origin $REMOTE_URL/$REMOTE_NAME $OSTREE_REF
fi

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

ostree log --repo=$OSTREE_REPO $OSTREE_REF

ostree summary --update --repo=$OSTREE_REPO

ostree summary --view --repo=$OSTREE_REPO

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 074cbaa

Please sign in to comment.