1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00

Merge branch 'main' into cache

This commit is contained in:
Jason N 2024-03-07 11:14:22 -06:00 committed by GitHub
commit 7b787903d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 15 deletions

View file

@ -13,7 +13,7 @@ env:
ARCH: 'x86_64' ARCH: 'x86_64'
IMAGE_NAME: 'base' IMAGE_NAME: 'base'
IMAGE_REPO: 'quay.io/fedora-ostree-desktops' IMAGE_REPO: 'quay.io/fedora-ostree-desktops'
VERSION: '39' IMAGE_TAG: '39'
VARIANT: 'Server' VARIANT: 'Server'
SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
ENROLLMENT_PASSWORD: 'container-installer' ENROLLMENT_PASSWORD: 'container-installer'
@ -64,6 +64,11 @@ jobs:
permissions: permissions:
contents: read contents: read
packages: write packages: write
strategy:
matrix:
version:
- 38
- 39
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -88,20 +93,21 @@ jobs:
arch: ${{ env.ARCH}} arch: ${{ env.ARCH}}
image_name: ${{ env.IMAGE_NAME}} image_name: ${{ env.IMAGE_NAME}}
image_repo: ${{ env.IMAGE_REPO}} image_repo: ${{ env.IMAGE_REPO}}
version: ${{ env.VERSION }} image_tag: ${{ env.IMAGE_TAG }}
version: ${{ matrix.version }}
variant: ${{ env.VARIANT }} variant: ${{ env.VARIANT }}
secure_boot_key_url: ${{ env.SECURE_BOOT_KEY_URL }} secure_boot_key_url: ${{ env.SECURE_BOOT_KEY_URL }}
enrollment_password: ${{ env.ENROLLMENT_PASSWORD }} enrollment_password: ${{ env.ENROLLMENT_PASSWORD }}
- name: Rename ISO - name: Rename ISO
run: | run: |
mv build/deploy.iso build/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso mv build/deploy.iso build/${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso
- name: Upload ISO as artifact - name: Upload ISO as artifact
id: upload id: upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso
path: build/*.iso path: build/*.iso
if-no-files-found: error if-no-files-found: error
retention-days: 0 retention-days: 0
@ -115,6 +121,11 @@ jobs:
permissions: permissions:
contents: read contents: read
packages: write packages: write
strategy:
matrix:
version:
- 38
- 39
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -131,15 +142,15 @@ jobs:
- name: Download generated ISO - name: Download generated ISO
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso
- name: Verify ISO - name: Verify ISO
run: checkisomd5 ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso run: checkisomd5 ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso
- name: Run ISO checks - name: Run ISO checks
run: | run: |
mv ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso deploy.iso mv ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso deploy.iso
make test-iso make test-iso VERSION=${{ matrix.version }}
- name: Add Kickstart and Grub options to ISO - name: Add Kickstart and Grub options to ISO
run: | run: |

View file

@ -11,6 +11,7 @@ REPOS = $(subst :,\:,$(shell ls /etc/yum.repos.d/*.repo))
ENROLLMENT_PASSWORD = ENROLLMENT_PASSWORD =
SECURE_BOOT_KEY_URL = SECURE_BOOT_KEY_URL =
ADDITIONAL_TEMPLATES = ADDITIONAL_TEMPLATES =
EXTRA_BOOT_PARAMS =
ROOTFS_SIZE = 4 ROOTFS_SIZE = 4
DNF_CACHE = DNF_CACHE =
@ -159,6 +160,8 @@ container/$(IMAGE_NAME)-$(IMAGE_TAG):
# Step 5: Generate xorriso script # Step 5: Generate xorriso script
xorriso/%.sh: xorriso/%.sh.in xorriso/%.sh: xorriso/%.sh.in
sed -i 's/quiet/quiet $(EXTRA_BOOT_PARAMS)/g' results/boot/grub2/grub.cfg
sed -i 's/quiet/quiet $(EXTRA_BOOT_PARAMS)/g' results/EFI/BOOT/grub.cfg
$(eval _VARS = IMAGE_NAME IMAGE_TAG ARCH VERSION) $(eval _VARS = IMAGE_NAME IMAGE_TAG ARCH VERSION)
$(foreach var,$(_VARS),$(var)=$($(var))) envsubst '$(foreach var,$(_VARS),$$$(var))' < $(_BASE_DIR)/xorriso/$*.sh.in > $(_BASE_DIR)/xorriso/$*.sh $(foreach var,$(_VARS),$(var)=$($(var))) envsubst '$(foreach var,$(_VARS),$$$(var))' < $(_BASE_DIR)/xorriso/$*.sh.in > $(_BASE_DIR)/xorriso/$*.sh

View file

@ -1,7 +1,7 @@
<%page args="image_repo, _image_repo_double_escaped, image_name, image_tag"/> <%page args="image_repo, _image_repo_double_escaped, image_name, image_tag"/>
if (which bootc &> /dev/null) if (which bootc &> /dev/null)
then then
bootc switch ${image_repo}/${image_name}:${image_tag} bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry ${image_repo}/${image_name}:${image_tag}
else else
sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_image_repo_double_escaped}\/${image_name}:${image_tag}/' /ostree/deploy/default/deploy/*.origin sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_image_repo_double_escaped}\/${image_name}:${image_tag}/' /ostree/deploy/default/deploy/*.origin
fi fi

View file

@ -5,14 +5,22 @@ echo "-outdev $(pwd)/build/deploy.iso"
echo "-boot_image any replay" echo "-boot_image any replay"
echo "-joliet on" echo "-joliet on"
echo "-compliance joliet_long_names" echo "-compliance joliet_long_names"
if [ -f $(pwd)/sb_pubkey.der ]; then echo "-map $(pwd)/results/boot/grub2/grub.cfg boot/grub2/grub.cfg"
echo "-chmod 0444 boot/grub2/grub.cfg"
echo "-map $(pwd)/results/EFI/BOOT/grub.cfg EFI/BOOT/grub.cfg"
echo "-chmod 0444 EFI/BOOT/grub.cfg"
if [ -f $(pwd)/sb_pubkey.der ]
then
echo "-map $(pwd)/sb_pubkey.der sb_pubkey.der" echo "-map $(pwd)/sb_pubkey.der sb_pubkey.der"
echo "-chmod 0444 /sb_pubkey.der" echo "-chmod 0444 /sb_pubkey.der"
fi fi
pushd container >/dev/null
for file in $(find ${IMAGE_NAME}-${IMAGE_TAG}); do pushd container > /dev/null
echo "-map $(pwd)/${file} ${file}" for file in $(find ${IMAGE_NAME}-${IMAGE_TAG})
echo "-chmod 0444 ${file}" do
echo "-map $(pwd)/${file} ${file}"
echo "-chmod 0444 ${file}"
done done
popd > /dev/null popd > /dev/null
echo "-end" echo "-end"