From e3db65cede666db59ed716a5996dfb64b615ee8c Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Wed, 9 Aug 2023 23:58:35 -0500 Subject: [PATCH] fix: improve handling of zfs tag for images (#62) --- .github/workflows/build.yml | 26 ++++++++++---------------- main/Containerfile | 4 ++-- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa25b00..6ef812e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -232,9 +232,9 @@ jobs: coreos_version: - stable - testing - add_zfs: - - false - - true + zfs_tag: + - "-zfs" + - "" pr_prefix: - ${{ needs.build_info.outputs.pr_prefix }} include: @@ -253,10 +253,7 @@ jobs: run: | # Generate a timestamp for creating an image version history TIMESTAMP="$(date +%Y%m%d)" - COREOS_VERSION="${{ matrix.coreos_version }}" - if [[ "${{ matrix.add_zfs }}" == "true" ]]; then - COREOS_VERSION="${{ matrix.coreos_version }}-zfs" - fi + COREOS_VERSION="${{ matrix.coreos_version }}${{ matrix.zfs_tag }}" COMMIT_TAGS=() BUILD_TAGS=() @@ -313,8 +310,8 @@ jobs: ${{ steps.generate-tags.outputs.alias_tags }} build-args: | COREOS_VERSION=${{ matrix.coreos_version }} - ADD_ZFS=${{ matrix.add_zfs }} PR_PREFIX=${{ matrix.pr_prefix }} + ZFS_TAG=${{ matrix.zfs_tag }} labels: ${{ steps.meta.outputs.labels }} oci: false @@ -386,9 +383,9 @@ jobs: coreos_version: - stable - testing - add_zfs: - - false - - true + zfs_tag: + - "-zfs" + - "" pr_prefix: - ${{ needs.build_info.outputs.pr_prefix }} include: @@ -407,10 +404,7 @@ jobs: run: | # Generate a timestamp for creating an image version history TIMESTAMP="$(date +%Y%m%d)" - COREOS_VERSION="${{ matrix.coreos_version }}" - if [[ "${{ matrix.add_zfs }}" == "true" ]]; then - COREOS_VERSION="${{ matrix.coreos_version }}-zfs" - fi + COREOS_VERSION="${{ matrix.coreos_version }}${{ matrix.zfs_tag }}" COMMIT_TAGS=() BUILD_TAGS=() @@ -468,7 +462,7 @@ jobs: build-args: | COREOS_VERSION=${{ matrix.coreos_version }} PR_PREFIX=${{ matrix.pr_prefix }} - ZFS_TAG=${{ 'true' == matrix.add_zfs && '-zfs' || '' }} + ZFS_TAG=${{ matrix.zfs_tag }} labels: ${{ steps.meta.outputs.labels }} oci: false diff --git a/main/Containerfile b/main/Containerfile index 34e4f2a..2386266 100644 --- a/main/Containerfile +++ b/main/Containerfile @@ -4,7 +4,7 @@ FROM quay.io/fedora/fedora-coreos:${COREOS_VERSION} ARG COREOS_VERSION="${COREOS_VERSION:-stable}" ARG IMAGE_NAME="${IMAGE_NAME:-ucore}" -ARG ADD_ZFS="${ADD_ZFS:-false}" +ARG ZFS_TAG="${ZFS_TAG}" ADD github-release-install.sh /tmp/github-release-install.sh ADD build.sh /tmp/build.sh @@ -25,7 +25,7 @@ for REPO in $(ls /etc/yum.repos.d/fedora-updates-testing{,-modular}.repo); do \ done; \ fi -RUN if [[ "true" == "${ADD_ZFS}" ]]; then \ +RUN if [[ "-zfs" == "${ZFS_TAG}" ]]; then \ rpm-ostree install /tmp/rpms/kmods/zfs/*.rpm; \ fi; \ /tmp/github-release-install.sh trapexit/mergerfs x86_64.rpm fc && \