Skip to content

perf(tests): share KafkaCluster across RecordEncryptionFilterIT tests… #487

perf(tests): share KafkaCluster across RecordEncryptionFilterIT tests…

perf(tests): share KafkaCluster across RecordEncryptionFilterIT tests… #487

Workflow file for this run

# docker.yaml - builds and pushes a kroxylicious container image.
#
# Requires repository variables:
# - REGISTRY_SERVER - the server of the container registry service e.g. `quay.io` or `docker.io`
# - REGISTRY_USERNAME - your username on the service (or username of your robot account)
# - REGISTRY_DESTINATION - the push destination (without tag portion) e.g. `quay.io/<my org>/kroxylicious`
# and a repository secret
# - REGISTRY_TOKEN - the access token that corresponds to `REGISTRY_USERNAME`
#
# If the required repository variables aren't set the workflow will be skipped. This means the workflow won't fail
# on the forks of developers who haven't configured the variables/secrets.
name: Docker Build
on:
workflow_dispatch:
push:
branches:
- 'main'
- 'release/**'
tags:
- 'v*.*.*'
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Test for Slack secret'
env:
KROXYLICIOUS_SLACK_WEBHOOK: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
run: |
echo "SLACK_WEBHOOK_SET=$(test ${KROXYLICIOUS_SLACK_WEBHOOK} && echo true)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Setup Java
uses: ./.github/actions/common/setup-java
- name: 'Cache Maven packages'
uses: ./.github/actions/common/cache-maven-packages
- name: Determine Build Configuration
id: build_configuration
run: |
RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "release_version=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
if [[ "${{ github.event_name }}" == "pull_request" || "${{ vars.REGISTRY_SERVER }}" == "" ]]; then
echo "proxy_tags=kroxylicious-proxy:${RELEASE_VERSION}" >> $GITHUB_OUTPUT
echo "operator_tags=kroxylicious-operator:${RELEASE_VERSION}" >> $GITHUB_OUTPUT
echo "push_images=false" >> $GITHUB_OUTPUT
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
else
PROXY_IMAGE="${{ vars.REGISTRY_SERVER }}/${{ vars.REGISTRY_ORGANISATION }}/${{ vars.PROXY_IMAGE_NAME }}"
OPERATOR_IMAGE="${{ vars.REGISTRY_SERVER }}/${{ vars.REGISTRY_ORGANISATION }}/${{ vars.OPERATOR_IMAGE_NAME }}"
echo "proxy_tags=${PROXY_IMAGE}:${RELEASE_VERSION}" >> $GITHUB_OUTPUT
echo "operator_tags=${OPERATOR_IMAGE}:${RELEASE_VERSION},${OPERATOR_IMAGE}:latest" >> $GITHUB_OUTPUT
echo "push_images=true" >> $GITHUB_OUTPUT
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
fi
- name: Build Kroxylicious distribution artifacts
run: |
mvn --quiet --batch-mode --activate-profiles dist \
--also-make --projects :kroxylicious-app,:kroxylicious-operator,:kroxylicious-operator-dist \
-Dquick -DskipContainerImageBuild=true package
- name: Login to container registry
if: steps.build_configuration.outputs.push_images == 'true'
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
with:
registry: ${{ vars.REGISTRY_SERVER }}
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and maybe push Proxy image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
context: ./kroxylicious-app
file: ./kroxylicious-app/src/main/docker/proxy.dockerfile
platforms: ${{ steps.build_configuration.outputs.platforms }}
push: ${{ steps.build_configuration.outputs.push_images == 'true' }}
build-args: |
KROXYLICIOUS_VERSION=${{ steps.build_configuration.outputs.release_version }}
tags: ${{ steps.build_configuration.outputs.proxy_tags }}
cache-from: type=gha
cache-to: type=gha,mode=max,compression=zstd
- name: Build and maybe push Operator image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
context: ./kroxylicious-operator
file: ./kroxylicious-operator/src/main/docker/operator.dockerfile
platforms: ${{ steps.build_configuration.outputs.platforms }}
push: ${{ steps.build_configuration.outputs.push_images == 'true' }}
build-args: |
KROXYLICIOUS_VERSION=${{ steps.build_configuration.outputs.release_version }}
tags: ${{ steps.build_configuration.outputs.operator_tags }}
cache-from: type=gha
cache-to: type=gha,mode=max,compression=zstd
- name: Slack Notification on Failure
if: failure() && env.SLACK_WEBHOOK_SET == 'true' && github.event_name == 'push'
uses: ./.github/actions/common/slack-notification
with:
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
slackTitle: 'Failure Alert: ${{ github.repository }}'
slackMessage: 'The docker build workflow failed on branch ${{ github.ref_name }}.'