Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-arch builds for hawtio-online-example images #47

Merged
merged 4 commits into from
Nov 1, 2024
Merged
Changes from 2 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
35 changes: 20 additions & 15 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
matrix:
java: ['17', '21']
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java
Expand All @@ -24,28 +26,31 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build
run: |
mvn --batch-mode --no-transfer-progress install -Djkube.build.strategy=docker
- name: List images
run: |
docker images
- name: Push image to Quay.io
- name: Build and push image to Quay.io
if: github.event_name == 'push'
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
run: |
docker login --help
docker login -u $USERNAME -p $PASSWORD quay.io
docker tag quay.io/hawtio/hawtio-online-example-camel-quarkus-kube:latest quay.io/hawtio/hawtio-online-example-camel-quarkus:${{matrix.java}}
docker tag quay.io/hawtio/hawtio-online-example-camel-springboot:latest quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}}

docker push quay.io/hawtio/hawtio-online-example-camel-quarkus:${{matrix.java}}
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}}
mvn --batch-mode --no-transfer-progress -pl '!camel-quarkus-openshift' install \
-Dquarkus.jib.base-jvm-image=registry.access.redhat.com/ubi9/openjdk-${{ matrix.java }}-runtime:latest \
-Dquarkus.jib.platforms=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \
-Dquarkus.container-image.name=hawtio-online-example-camel-quarkus \
-Dquarkus.container-image.tag=${{ matrix.java }} \
-Dquarkus.container-image.push=true \
-Djkube.generator.from=registry.access.redhat.com/ubi9/openjdk-${{ matrix.java }}:latest \
-Djkube.build.strategy=docker

docker buildx build -t quay.io/hawtio/hawtio-online-example-camel-springboot:${{ matrix.java }} \
--platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \
--provenance=false \
--push \
camel-springboot/target/docker/quay.io/hawtio/hawtio-online-example-camel-springboot/latest/build/

if [[ "${{matrix.java}}" == "21" ]]; then
docker tag quay.io/hawtio/hawtio-online-example-camel-quarkus-kube:latest quay.io/hawtio/hawtio-online-example-camel-quarkus:latest
docker push quay.io/hawtio/hawtio-online-example-camel-quarkus:latest
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:latest
if [[ "${{ matrix.java }}" == "21" ]]; then
docker buildx imagetools create -t quay.io/hawtio/hawtio-online-example-camel-quarkus:latest quay.io/hawtio/hawtio-online-example-camel-quarkus:${{ matrix.java }}
docker buildx imagetools create -t quay.io/hawtio/hawtio-online-example-camel-springboot:latest quay.io/hawtio/hawtio-online-example-camel-springboot:${{ matrix.java }}
fi