Skip to content

Commit

Permalink
feat: Add bake-config-file input to build-product-image action (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Techassi authored Oct 11, 2024
1 parent 9bd1325 commit 01e3c0f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions build-product-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) <!-- TODO: make the cache optional -->
- `build-cache-password` (required) <!-- TODO: make the cache optional -->
- `bake-config-file` (defaults to `./conf.py`)

### Outputs

Expand Down
25 changes: 14 additions & 11 deletions build-product-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand Down

0 comments on commit 01e3c0f

Please sign in to comment.