Skip to content

Commit

Permalink
Merge pull request #1991 from Apicurio/chore/fix-docker-compose-mysql
Browse files Browse the repository at this point in the history
Fixed the docker compose for running with mysql
  • Loading branch information
carlesarnal authored Aug 24, 2022
2 parents df81f7b + 333658d commit efc76f4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/release-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -38,17 +38,17 @@ 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
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
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
Expand All @@ -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

Expand Down Expand Up @@ -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: |
Expand All @@ -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: |
Expand All @@ -152,4 +152,4 @@ jobs:
with:
name: ${{ github.job }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}
status: ${{ job.status }}
4 changes: 4 additions & 0 deletions distro/docker-compose/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions distro/docker-compose/docker-compose.apicurio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions distro/docker-compose/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit efc76f4

Please sign in to comment.