From 333658d0af203311e3fa870b099102558b379532 Mon Sep 17 00:00:00 2001 From: Eric Wittmann Date: Tue, 23 Aug 2022 16:06:59 -0400 Subject: [PATCH] Fixed the docker compose for running with mysql --- .github/workflows/release-images.yaml | 24 +++++++++---------- distro/docker-compose/.env.template | 4 ++++ .../docker-compose.apicurio.yml | 4 ++-- distro/docker-compose/setup.sh | 4 ++++ 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-images.yaml b/.github/workflows/release-images.yaml index d13faffe5..352b5ed96 100644 --- a/.github/workflows/release-images.yaml +++ b/.github/workflows/release-images.yaml @@ -15,12 +15,12 @@ jobs: # Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine - name: Set up QEMU uses: docker/setup-qemu-action@v1 - + # Docker CLI plugin for extended build capabilities with BuildKit - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 - + - name: Inspect builder run: | echo "Name: ${{ steps.buildx.outputs.name }}" @@ -38,9 +38,9 @@ jobs: - name: Download Source Code run: wget -c $SOURCE_CODE_URL && unzip $RELEASE_VERSION && ls -lrt && mv ${{github.repository_owner}}* studio - + # We have faced issues in the past where a github release was created from a wrong commit - # This step will ensure that the release was created from the right commit + # This step will ensure that the release was created from the right commit - name: Verify Project Version run: | cd studio @@ -48,7 +48,7 @@ jobs: if [[ $PROJECT_VERSION != $RELEASE_VERSION ]] then echo "ERROR: Project Version '${PROJECT_VERSION}' does not match with Released Version '${RELEASE_VERSION}'" - exit 1 + exit 1 fi - name: Set up JDK 11 @@ -60,10 +60,10 @@ jobs: # With the update to quarkus this will build the default images with postgres as the fixed database - name: Build Project run: cd studio && mvn clean install -Pprod - + - name: Login to DockerHub Registry run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - + - name: Login to Quay.io Registry run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io @@ -119,8 +119,8 @@ jobs: - name: Build and Publish Studio API uses: docker/build-push-action@v2 with: - context: ./api - file: ./api/Dockerfile + context: ./studio/platforms/quarkus/api + file: ./studio/platforms/quarkus/api/Dockerfile platforms: ${{env.PLATFORMS}} push: true tags: | @@ -134,8 +134,8 @@ jobs: - name: Build and Publish Studio WS uses: docker/build-push-action@v2 with: - context: ./ws - file: ./ws/Dockerfile + context: ./studio/platforms/quarkus/ws + file: ./studio/platforms/quarkus/ws/Dockerfile platforms: ${{env.PLATFORMS}} push: true tags: | @@ -152,4 +152,4 @@ jobs: with: name: ${{ github.job }} url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }} - status: ${{ job.status }} \ No newline at end of file + status: ${{ job.status }} diff --git a/distro/docker-compose/.env.template b/distro/docker-compose/.env.template index fc29cd158..8cb9868d5 100644 --- a/distro/docker-compose/.env.template +++ b/distro/docker-compose/.env.template @@ -3,6 +3,10 @@ APICURIO_API_VERSION=latest-release APICURIO_WS_VERSION=latest-release APICURIO_UI_VERSION=latest-release +#APICURIO VARIANT +APICURIO_API_VARIANT=$API_VARIANT +APICURIO_WS_VARIANT=$WS_VARIANT + #HOSTNAME OR IP ADDRESS HOST=$HOST diff --git a/distro/docker-compose/docker-compose.apicurio.yml b/distro/docker-compose/docker-compose.apicurio.yml index f7593eb53..ca1b7687d 100644 --- a/distro/docker-compose/docker-compose.apicurio.yml +++ b/distro/docker-compose/docker-compose.apicurio.yml @@ -2,7 +2,7 @@ version: '3' services: apicurio-studio-ws: - image: 'apicurio/apicurio-studio-ws:${APICURIO_WS_VERSION}' + image: 'apicurio/apicurio-studio-ws${APICURIO_WS_VARIANT}:${APICURIO_WS_VERSION}' depends_on: [apicurio-studio-db] ports: - '8092:8080' @@ -19,7 +19,7 @@ services: apicurio-studio-api: - image: 'apicurio/apicurio-studio-api:${APICURIO_API_VERSION}' + image: 'apicurio/apicurio-studio-api${APICURIO_API_VARIANT}:${APICURIO_API_VERSION}' depends_on: [apicurio-studio-db, apicurio-studio-ws] ports: - '8091:8080' diff --git a/distro/docker-compose/setup.sh b/distro/docker-compose/setup.sh index 3b710f2e2..c97fa3ac6 100755 --- a/distro/docker-compose/setup.sh +++ b/distro/docker-compose/setup.sh @@ -46,12 +46,16 @@ then sed 's/$KC_DB_ADDR/'"jboss-keycloak-mysql"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env sed 's/$DB_DRIVER/'"mysql"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env sed 's/$DB_CONN_URL/'"jdbc:mysql:\\/\\/apicurio-studio-db\\/apicuriodb"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env + sed 's/$API_VARIANT/'"-mysql"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env + sed 's/$WS_VARIANT/'"-mysql"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env else sed 's/$DB_TYPE/'"postgresql9"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env sed 's/$KC_DB_VENDOR/'"postgres"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env sed 's/$KC_DB_ADDR/'"jboss-keycloak-postgresql"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env sed 's/$DB_DRIVER/'"postgresql"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env sed 's/$DB_CONN_URL/'"jdbc:postgresql:\\/\\/apicurio-studio-db\\/apicuriodb"'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env + sed 's/$API_VARIANT/'""'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env + sed 's/$WS_VARIANT/'""'/g' $P/.env > $P/tmp; mv $P/tmp $P/.env fi