Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/smoke-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ jobs:
with:
product-version: ${{ matrix.versions }}
boil-config-file: smoke/container-image/boil.toml
boil-version: latest
boil-version: 0.2.3-rc.1
registry-namespace: smoke
extra-tag-data: pr-321
product-name: smoke/container-image
floating-tag: "true"

- name: Publish Container Image on oci.stackable.tech
uses: ./publish-image
Expand Down
50 changes: 41 additions & 9 deletions build-product-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ inputs:
registry-namespace:
description: Path of the registry namespace, eg. `sdp` or `stackable`
required: true
floating-tag:
description: Whether a floating tag should be added to the final image
default: "false"
outputs:
image-manifest-tag:
description: |
Expand All @@ -38,6 +41,19 @@ outputs:
runs:
using: composite
steps:
- name: Validate inputs
env:
FLOATING_TAG: ${{ inputs.floating-tag }}
shell: bash
run: |
set -euo pipefail
[ -n "${RUNNER_DEBUG+set}" ] && set -x

if [ "$FLOATING_TAG" != 'true' ] && [ "$FLOATING_TAG" != 'false' ]; then
echo 'The floating-tag input must be either "true" or "false".'
exit 1
fi

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0

Expand All @@ -55,6 +71,7 @@ runs:
BOIL_CONFIG_FILE: ${{ inputs.boil-config-file }}
IMAGE_REPOSITORY: ${{ inputs.product-name }}
EXTRA_TAG_DATA: ${{ inputs.extra-tag-data }}
FLOATING_TAG: ${{ inputs.floating-tag }}
SDP_VERSION: ${{ inputs.sdp-version }}
shell: bash
run: |
Expand All @@ -77,15 +94,30 @@ runs:
fi

echo "::group::boil"
boil build \
--image-version "$IMAGE_INDEX_MANIFEST_TAG" \
--registry-namespace "$REGISTRY_NAMESPACE" \
--target-platform "linux/${IMAGE_ARCH}" \
--configuration "$BOIL_CONFIG_FILE" \
--write-image-manifest-uris \
--use-localhost-registry \
"$IMAGE_REPOSITORY=$BOIL_PRODUCT_VERSION" \
-- --load
# FIXME (@Techassi): We could get rid of this if block if we would support --floating-tag=true/false in boil
# See https://github.com/clap-rs/clap/issues/1649
if [ "$FLOATING_TAG" == 'true' ]; then
boil build \
--image-version "$IMAGE_INDEX_MANIFEST_TAG" \
--registry-namespace "$REGISTRY_NAMESPACE" \
--target-platform "linux/${IMAGE_ARCH}" \
--configuration "$BOIL_CONFIG_FILE" \
--write-image-manifest-uris \
--use-localhost-registry \
--floating-tag \
"$IMAGE_REPOSITORY=$BOIL_PRODUCT_VERSION" \
-- --load
else
boil build \
--image-version "$IMAGE_INDEX_MANIFEST_TAG" \
--registry-namespace "$REGISTRY_NAMESPACE" \
--target-platform "linux/${IMAGE_ARCH}" \
--configuration "$BOIL_CONFIG_FILE" \
--write-image-manifest-uris \
--use-localhost-registry \
"$IMAGE_REPOSITORY=$BOIL_PRODUCT_VERSION" \
-- --load
fi
echo "::endgroup::"

echo "boil-target-tags: "$(< boil-target-tags)
Expand Down
Loading