From 01e3c0f8a2de769e3a075e3663da043632be17d9 Mon Sep 17 00:00:00 2001 From: Techassi Date: Fri, 11 Oct 2024 11:53:48 +0200 Subject: [PATCH] feat: Add bake-config-file input to build-product-image action (#7) --- build-product-image/README.md | 1 + build-product-image/action.yml | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/build-product-image/README.md b/build-product-image/README.md index 22793af..648cc8c 100644 --- a/build-product-image/README.md +++ b/build-product-image/README.md @@ -46,6 +46,7 @@ localhost/kafka:3.4.1-stackable0.0.0-dev-amd64 - `image-tools-version` (eg: `0.0.13`) - `build-cache-username` (required) - `build-cache-password` (required) +- `bake-config-file` (defaults to `./conf.py`) ### Outputs diff --git a/build-product-image/action.yml b/build-product-image/action.yml index 4c73361..47dd0f3 100644 --- a/build-product-image/action.yml +++ b/build-product-image/action.yml @@ -17,6 +17,9 @@ inputs: build-cache-password: description: Build cache password required: true + bake-config-file: + description: Path to the bake config file, defaults to `./conf.py` + default: ./conf.py outputs: image-manifest-tag: description: | @@ -53,10 +56,6 @@ runs: sudo apt update sudo apt install -y python3 - - name: Building ${{ inputs.product-name }} - shell: bash - run: echo ${{ inputs.product-name }} - - name: Install image-tools-stackabletech shell: bash run: pip install image-tools-stackabletech==${{ inputs.image-tools-version }} @@ -69,21 +68,25 @@ runs: username: ${{ inputs.build-cache-username }} password: ${{ inputs.build-cache-password }} - - name: Build image using bake + - name: Building ${{ inputs.product-name }} Container Image using bake env: - IMAGE_REPOSITORY: ${{ inputs.product-name }} BAKE_PRODUCT_VERSION: ${{ inputs.product-version }} + BAKE_CONFIG_FILE: ${{ inputs.bake-config-file }} + IMAGE_REPOSITORY: ${{ inputs.product-name }} shell: bash run: | set -euo pipefail IMAGE_ARCH="$(uname -m | sed -e 's#x86_64#amd64#' | sed -e 's#aarch64#arm64#')" + echo "::group::bake" bake \ - --product $IMAGE_REPOSITORY=$BAKE_PRODUCT_VERSION \ - --image-version "0.0.0-dev-${IMAGE_ARCH}" \ - --architecture "linux/${IMAGE_ARCH}" \ - --export-tags-file bake-target-tags \ - --cache + --product "$IMAGE_REPOSITORY=$BAKE_PRODUCT_VERSION" \ + --image-version "0.0.0-dev-${IMAGE_ARCH}" \ + --architecture "linux/${IMAGE_ARCH}" \ + --export-tags-file bake-target-tags \ + --configuration "$BAKE_CONFIG_FILE" \ + --cache + echo "::endgroup::"" - name: Re-tag Image (Temporary) shell: bash