Skip to content

Commit

Permalink
Update to Strimzi 0.39.0 and move to GitHub Actions
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Scholz <[email protected]>
  • Loading branch information
scholzj committed Dec 23, 2023
1 parent e090d2f commit 1d511c5
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 87 deletions.
80 changes: 0 additions & 80 deletions .circleci/config.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Kafka Test Apps

on:
push:
branches: [ "main" ]

jobs:
build:
name: Build
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

env:
DOCKER_REGISTRY: ghcr.io
DOCKER_ORG: ${{ github.actor }}
DOCKER_TAG: latest

steps:
# Checkout sources
- uses: actions/checkout@v3

# Setup QEMU for multiplatform Docker builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# Setup Docker credentials
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build the Container images
- name: Build and push the containers for amd64
run: make docker_build docker_push docker_amend_manifest
env:
DOCKER_ARCHITECTURE: amd64
- name: Build and push the containers for arm64
run: make docker_build docker_push docker_amend_manifest
env:
DOCKER_ARCHITECTURE: arm64

# Push the container manifest
- name: Push the container manifest
run: make docker_push_manifest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/strimzi/kafka:0.38.0-kafka-3.6.0
FROM quay.io/strimzi/kafka:0.39.0-kafka-3.6.1

LABEL org.opencontainers.image.source=https://github.com/scholzj/zoo-entrance
LABEL org.opencontainers.image.title="Zoo Entrance"
Expand Down
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,29 @@ DOCKER_ORG ?= $(USER)
DOCKER_IMAGE ?= zoo-entrance
DOCKER_TAG ?= latest

ifdef DOCKER_ARCHITECTURE
DOCKER_PLATFORM = --platform linux/$(DOCKER_ARCHITECTURE)
DOCKER_PLATFORM_TAG_SUFFIX = -$(DOCKER_ARCHITECTURE)
endif

all: docker_build docker_push

docker_build:
# Build Docker image ...
docker build -t $(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKERFILE_DIR)
echo "Building Docker image ..."
docker build --no-cache $(DOCKER_PLATFORM) -t $(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX) $(DOCKERFILE_DIR)

docker_tag:
# Tag the $(BUILD_TAG) image we built with the given $(DOCKER_TAG) tag
docker tag $(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)
echo "Tagging $(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX) to $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX) ..."
docker tag $(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX) $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX)

docker_push: docker_tag
# Push the $(DOCKER_TAG)-tagged image to the registry
docker push $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)
echo "Pushing $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX) ..."
docker push $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX)

docker_amend_manifest:
# Create / Amend the manifest
docker manifest create $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG) --amend $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)$(DOCKER_PLATFORM_TAG_SUFFIX)

docker_push_manifest:
# Push the manifest to the registry
docker manifest push $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE):$(DOCKER_TAG)

0 comments on commit 1d511c5

Please sign in to comment.