Skip to content

Commit

Permalink
multi platform docker images for snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Nov 27, 2023
1 parent d97e6c6 commit 4ca8f5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/maven-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
java-version: ${{ matrix.java }}
distribution: temurin
cache: maven
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Login
run: |
docker login --username=${{ secrets.DOCKERHUB_SB_USERNAME }} --password=${{ secrets.DOCKERHUB_SB_PASSWORD }}
Expand Down Expand Up @@ -50,9 +54,9 @@ jobs:
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
then
./mvnw clean deploy -U --settings $HOME/.m2/settings.xml
docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME:unstable ./modules/swagger-generator
docker buildx build --platform=linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME:unstable ./modules/swagger-generator
docker push $DOCKER_GENERATOR_IMAGE_NAME:unstable
docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:unstable ./modules/swagger-codegen-cli
docker build --platform=linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:unstable ./modules/swagger-codegen-cli
docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME:unstable
else
echo "not deploying release nor building and pushing release docker image: " ${MY_POM_VERSION}
Expand Down
4 changes: 2 additions & 2 deletions bin/docker/build_and_push_docker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

if [ $DOCKER_HUB_USERNAME ]; then docker login --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi
if [ $DOCKER_HUB_USERNAME ]; then docker login --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi
if [ "$DOCKER_HUB_USERNAME" ]; then docker login --username="$DOCKER_HUB_USERNAME" --password="$DOCKER_HUB_PASSWORD" && docker buildx build --platform linux/arm64/v8,linux/amd64 --rm=false -t "$DOCKER_GENERATOR_IMAGE_NAME" ./modules/swagger-generator && if [ -n "$CIRCLE_TAG" ]; then docker tag "$DOCKER_GENERATOR_IMAGE_NAME:latest" "$DOCKER_GENERATOR_IMAGE_NAME:$CIRCLE_TAG"; fi && if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push "$DOCKER_GENERATOR_IMAGE_NAME"; fi; fi
if [ "$DOCKER_HUB_USERNAME" ]; then docker login --username="$DOCKER_HUB_USERNAME" --password="$DOCKER_HUB_PASSWORD" && docker buildx build --platform linux/arm64/v8,linux/amd64 --rm=false -t "$DOCKER_CODEGEN_CLI_IMAGE_NAME" ./modules/swagger-codegen-cli && if [ -n "$CIRCLE_TAG" ]; then docker tag "$DOCKER_CODEGEN_CLI_IMAGE_NAME:latest" "$DOCKER_CODEGEN_CLI_IMAGE_NAME:$CIRCLE_TAG"; fi && if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push "$DOCKER_CODEGEN_CLI_IMAGE_NAME"; fi; fi

0 comments on commit 4ca8f5b

Please sign in to comment.