Skip to content

Commit

Permalink
fix: improve handling of zfs tag for images (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsherman authored Aug 10, 2023
1 parent ab204e5 commit e3db65c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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=()
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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=()
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions main/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 && \
Expand Down

0 comments on commit e3db65c

Please sign in to comment.