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

Commit

Permalink
Fix links, configure variant in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe committed Oct 19, 2023
1 parent 4d49905 commit fb68e88
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 26 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ jobs:
- name: Build the image
run: ./build ostreeImage-${{ matrix.arch }}
working-directory: ./debian
- name: Upload ${{ matrix.arch }} image
- name: Rename build artifact
run: mv *ostreeImage-${{ matrix.arch }}-trixie-*.ostree.raw ostree-debian-image-${{ matrix.arch }}.tar.gz
working-directory: ./debian/.build
- name: Upload debian ${{ matrix.arch }} image
uses: actions/upload-artifact@v3
with:
name: ostree-${{ matrix.arch }}-trixie-image
path: debian/.build/*ostreeImage-${{ matrix.arch }}-trixie-*.ostree.raw
name: ostree-debian-image-${{ matrix.arch }}
path: debian/.build/ostree-debian-image-${{ matrix.arch }}.tar.gz
retention-days: 2

gardenlinux-image:
Expand All @@ -30,17 +33,22 @@ jobs:
fail-fast: false
matrix:
arch: [ amd64, arm64 ]
platform: [ kvm ]
platform: [ kvm, metal ]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Configure Build Variant
run: echo ${{ matrix.platform }} > features/ostreeImage/BUILD_VARIANT
- name: Build the image
run: ./build ostreeImage-${{ matrix.arch }}
working-directory: ./gardenlinux
- name: Upload ${{ matrix.arch }} image
- name: Rename build artifact
run: mv *ostreeImage-${{ matrix.arch }}-today-*.ostree.raw ostree-gardenlinux-image-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
working-directory: ./gardenlinux/.build
- name: Upload gardenlinux ${{ matrix.platform }} ${{ matrix.arch }} image
uses: actions/upload-artifact@v3
with:
name: ostreeImage-${{ matrix.arch }}
path: gardenlinux/.build/*ostreeImage-${{ matrix.arch }}-today-*.ostree.raw
name: ostree-gardenlinux-image-${{ matrix.platform }}-${{ matrix.arch }}
path: gardenlinux/.build/ostree-gardenlinux-image-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
retention-days: 2
3 changes: 3 additions & 0 deletions .github/workflows/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Configure Build Variant
run: echo ${{ matrix.platform }} > features/ostreeRepo/BUILD_VARIANT
working-directory: ./gardenlinux
- name: Build the repo
run: ./build ${{ matrix.platform }}_dev_curl-ostreeRepo-${{ matrix.arch }}
working-directory: ./gardenlinux
Expand Down
6 changes: 1 addition & 5 deletions debian/features/ostreeImage/image.ostree.raw
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ OSTREE_SYSROOT="$MYROOT/sysroot"
OSTREE_REPO=$OSTREE_SYSROOT/ostree/repo
OSTREE_REF="debian/testing/$BUILDER_ARCH"

# REPO_CNAME=$(echo $BUILDER_CNAME | sed 's/Image/Repo/g')
# FIXME proper name building
REPO_CNAME=ostreeRepo-${BUILDER_ARCH}-trixie
REMOTE_NAME="$REPO_CNAME".ostreeRepo
REMOTE_ARCHIVE_NAME="$REMOTE_NAME.tar.gz"
REMOTE_URL="http://ostree.gardenlinux.io"
REMOTE_ARCHIVE_NAME=ostree-debian-repo-${BUILDER_ARCH}.tar.gz

rootfs="$1"
output="$2"
Expand Down
8 changes: 5 additions & 3 deletions debian/features/ostreeRepo/image.ostreeRepo.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ 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"
REMOTE_ARCHIVE_NAME=ostree-debian-repo-${BUILDER_ARCH}.tar.gz
REMOTE_NAME=debian-repo-${BUILDER_ARCH}

rootfs="$1"
output="$2"
Expand All @@ -43,9 +43,11 @@ if curl --head --silent --fail $REMOTE_URL/$REMOTE_ARCHIVE_NAME 2> /dev/null;
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 $REMOTE_URL/$REMOTE_NAME $OSTREE_REF
fi

ostree remote --repo=$OSTREE_REPO delete --if-exists origin
ostree remote --repo=$OSTREE_REPO add --no-gpg-verify --no-sign-verify origin $REMOTE_URL/$REMOTE_NAME $OSTREE_REF

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
1 change: 1 addition & 0 deletions gardenlinux/features/ostreeImage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_VARIANT
10 changes: 3 additions & 7 deletions gardenlinux/features/ostreeImage/image.ostree.raw
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@ OSTREE_SYSROOT="$MYROOT/sysroot"
OSTREE_REPO=$OSTREE_SYSROOT/ostree/repo
OSTREE_REF="gardenlinux/today/$BUILDER_ARCH"

# REPO_CNAME=$(echo $BUILDER_CNAME | sed 's/Image/Repo/g')
# FIXME proper name building

REPO_CNAME=kvm-ostreeRepo_curl_dev-${BUILDER_ARCH}-today
REMOTE_NAME="$REPO_CNAME".ostreeRepo
REMOTE_ARCHIVE_NAME="$REMOTE_NAME.tar.gz"
# BUILD_VARIANT determains which repo we need to download (like metal, kvm, gcp, aws, azure, ..)
BUILD_VARIANT=$(cat /builder/features/ostreeImage/BUILD_VARIANT)
REMOTE_URL="http://ostree.gardenlinux.io"
REMOTE_ARCHIVE_NAME=ostree-gardenlinux-repo-${BUILD_VARIANT}-${BUILDER_ARCH}.tar.gz

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

tar xf "$rootfs" -C "$rootfs_work"


mkdir -p $OSTREE_REPO
mkdir -p $OSTREE_SYSROOT
download="$(mktemp -d)"
Expand Down
1 change: 1 addition & 0 deletions gardenlinux/features/ostreeRepo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_VARIANT
12 changes: 8 additions & 4 deletions gardenlinux/features/ostreeRepo/image.ostreeRepo.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ OSTREE_SYSROOT="$MYROOT/sysroot"
OSTREE_REPO=$OSTREE_SYSROOT/ostree/repo
OSTREE_REF="gardenlinux/today/$BUILDER_ARCH"

REMOTE_NAME="$BUILDER_CNAME".ostreeRepo
REMOTE_ARCHIVE_NAME="$REMOTE_NAME.tar.gz"
# BUILD_VARIANT determains which repo we need to download (like metal, kvm, gcp, aws, azure, ..)
BUILD_VARIANT=$(cat /builder/features/ostreeRepo/BUILD_VARIANT)
REMOTE_URL="http://ostree.gardenlinux.io"
REMOTE_ARCHIVE_NAME=ostree-gardenlinux-repo-${BUILD_VARIANT}-${BUILDER_ARCH}.tar.gz
REMOTE_NAME=gardenlinux-repo-${BUILD_VARIANT}-${BUILDER_ARCH}

rootfs="$1"
output="$2"
Expand All @@ -43,10 +45,12 @@ if curl --head --silent --fail $REMOTE_URL/$REMOTE_ARCHIVE_NAME 2> /dev/null;
ostree admin init-fs --modern $OSTREE_SYSROOT
ostree admin os-init --sysroot=$OSTREE_SYSROOT gardenlinux
ostree config --repo=$OSTREE_REPO set sysroot.bootloader none
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 "Garden Linux $REMOTE_NAME $(date --utc +%Y-%m-%dT%H:%M%Z)" "$rootfs_work"
ostree remote --repo=$OSTREE_REPO delete --if-exists origin
ostree remote --repo=$OSTREE_REPO add --no-gpg-verify --no-sign-verify origin $REMOTE_URL/$REMOTE_NAME $OSTREE_REF

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

ostree log --repo=$OSTREE_REPO $OSTREE_REF

Expand Down

0 comments on commit fb68e88

Please sign in to comment.