From a84675a640f3e702547e962db2129eba0764be81 Mon Sep 17 00:00:00 2001 From: Michael Baumberger Date: Fri, 22 Dec 2023 11:05:06 +0100 Subject: [PATCH] - github action checkout v3 -> v4 - github action setup-java v2 -> v4 --- .env | 2 ++ .env.override | 0 .github/workflows/deploy.yaml | 4 ++-- .github/workflows/sonarqube.yml | 4 ++-- docker-compose.yml | 38 ++++++++++++++++++++++++++------- docker-down.sh | 1 + docker-up.sh | 1 + gateway-service/pom.xml | 5 +++++ 8 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 .env.override create mode 100644 docker-down.sh create mode 100644 docker-up.sh diff --git a/.env b/.env index 23e8f69a..f9aafc32 100644 --- a/.env +++ b/.env @@ -1,3 +1,5 @@ +SPRING_ACTIVE_PROFILES=prod + USERMANAGEMENT_DB_PASSWORD=PleaseChangeMe USERMANAGEMENT_DB=usermanagement diff --git a/.env.override b/.env.override new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 411e456f..bad43040 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,9 +10,9 @@ jobs: name: 'Build, upload docker containers and deploy' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '21' diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 516c8de1..cd071d95 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -7,11 +7,11 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 21 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '21' diff --git a/docker-compose.yml b/docker-compose.yml index e4ebbd56..4b6ad823 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,12 @@ services: registry-service: image: 70131370/registry-service:1.0.0-TEST-6 + env_file: + - .env + - .env.override restart: always environment: - spring_profiles_active: prod + spring_profiles_active: ${SPRING_ACTIVE_PROFILES} expose: - "8761" networks: @@ -14,11 +17,14 @@ services: admin-service: image: 70131370/admin-service:1.0.0-TEST-6 + env_file: + - .env + - .env.override restart: always depends_on: - registry-service environment: - spring_profiles_active: prod + spring_profiles_active: ${SPRING_ACTIVE_PROFILES} expose: - "80" networks: @@ -26,11 +32,14 @@ services: javadoc-service: image: 70131370/javadoc-service:1.0.0-TEST-6 + env_file: + - .env + - .env.override restart: always depends_on: - registry-service environment: - spring_profiles_active: prod + spring_profiles_active: ${SPRING_ACTIVE_PROFILES} expose: - "80" networks: @@ -38,11 +47,14 @@ services: authentication-service: image: 70131370/authentication-service:1.0.0-TEST-6 + env_file: + - .env + - .env.override restart: always depends_on: - registry-service environment: - spring_profiles_active: prod + spring_profiles_active: ${SPRING_ACTIVE_PROFILES} expose: - "80" networks: @@ -50,9 +62,11 @@ services: authentication-db: image: mysql:8.0 + env_file: + - .env + - .env.override restart: always environment: - spring_profiles_active: prod MYSQL_ROOT_PASSWORD: ${AUTHENTICATION_DB_PASSWORD} MYSQL_DATABASE: ${AUTHENTICATION_DB} expose: @@ -62,12 +76,15 @@ services: usermanagement-service: image: 70131370/usermanagement-service:1.0.0-TEST-6 + env_file: + - .env + - .env.override restart: always depends_on: - registry-service - usermanagement-db environment: - spring_profiles_active: prod + spring_profiles_active: ${SPRING_ACTIVE_PROFILES} DATABASE_PASSWORD: ${USERMANAGEMENT_DB_PASSWORD} DATABASE: ${USERMANAGEMENT_DB} expose: @@ -77,9 +94,11 @@ services: usermanagement-db: image: mysql:8.0 + env_file: + - .env + - .env.override restart: always environment: - spring_profiles_active: prod MYSQL_ROOT_PASSWORD: ${USERMANAGEMENT_DB_PASSWORD} MYSQL_DATABASE: ${USERMANAGEMENT_DB} expose: @@ -89,6 +108,9 @@ services: gateway-service: image: 70131370/gateway-service:1.0.0-TEST-6 + env_file: + - .env + - .env.override restart: always depends_on: - registry-service @@ -99,7 +121,7 @@ services: ports: - "80:80" environment: - spring_profiles_active: prod + spring_profiles_active: ${SPRING_ACTIVE_PROFILES} networks: - microservice-network diff --git a/docker-down.sh b/docker-down.sh new file mode 100644 index 00000000..1c3e9cae --- /dev/null +++ b/docker-down.sh @@ -0,0 +1 @@ +docker compose down \ No newline at end of file diff --git a/docker-up.sh b/docker-up.sh new file mode 100644 index 00000000..2f7d62c6 --- /dev/null +++ b/docker-up.sh @@ -0,0 +1 @@ +docker compose up --build -d \ No newline at end of file diff --git a/gateway-service/pom.xml b/gateway-service/pom.xml index a2b396fb..2fbbe016 100644 --- a/gateway-service/pom.xml +++ b/gateway-service/pom.xml @@ -13,6 +13,11 @@ gateway-service gateway-service + + 21 + 21 + + org.springframework.boot