From 6113432a14c476a3a0dfc0d449e17d023697f2ba Mon Sep 17 00:00:00 2001 From: Janis Date: Thu, 30 Apr 2026 10:55:20 +0200 Subject: [PATCH] feat(config): update application.yml for staging and production environments --- .github/workflows/native-image.yml | 13 +++++++-- .../src/main/resources/application.yml | 27 ++++++++++++++----- .../src/main/resources/application.yml | 14 ++++++++++ .../src/main/resources/application.yml | 17 +++++++++++- .../core/src/main/resources/application.yml | 17 ++++++++++-- modules/core/src/main/resources/import.sql | 6 ----- modules/io/src/main/resources/application.yml | 16 ++++++++++- .../official-bots}/reachability-metadata.json | 0 .../src/main/resources/application.yml | 14 ++++++++++ .../rule/src/main/resources/application.yml | 16 ++++++++++- .../store/src/main/resources/application.yml | 16 +++++++++++ modules/ws/src/main/resources/application.yml | 16 +++++++++++ 12 files changed, 153 insertions(+), 19 deletions(-) delete mode 100644 modules/core/src/main/resources/import.sql rename modules/official-bots/src/main/resources/{META-INF.native-image.de.nowchess.bot => META-INF/native-image/de/nowchess/official-bots}/reachability-metadata.json (100%) diff --git a/.github/workflows/native-image.yml b/.github/workflows/native-image.yml index 8c77b50..becd74d 100644 --- a/.github/workflows/native-image.yml +++ b/.github/workflows/native-image.yml @@ -12,12 +12,21 @@ jobs: outputs: allowed: ${{ steps.check.outputs.allowed }} steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - id: check run: | - if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.actor }}" == "TeamCity" ]]; then + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "allowed=true" >> "$GITHUB_OUTPUT" else - echo "allowed=false" >> "$GITHUB_OUTPUT" + COMMIT_AUTHOR=$(git log -1 --format='%an') + if [[ "$COMMIT_AUTHOR" == "TeamCity" ]]; then + echo "allowed=true" >> "$GITHUB_OUTPUT" + else + echo "allowed=false" >> "$GITHUB_OUTPUT" + fi fi build-and-push: diff --git a/modules/account/src/main/resources/application.yml b/modules/account/src/main/resources/application.yml index 898d3af..7e065f7 100644 --- a/modules/account/src/main/resources/application.yml +++ b/modules/account/src/main/resources/application.yml @@ -37,17 +37,19 @@ nowchess: rest-client: core-service: url: ${CORE_SERVICE_URL} - nowchess: - redis: - host: ${REDIS_HOST:localhost} - port: ${REDIS_PORT:6379} - prefix: ${REDIS_PREFIX:nowchess} datasource: db-kind: postgresql username: ${DB_USER} password: ${DB_PASSWORD} jdbc: url: ${DB_URL} + nowchess: + redis: + host: ${REDIS_HOST:localhost} + port: ${REDIS_PORT:6379} + prefix: ${REDIS_PREFIX:nowchess} + internal: + secret: ${INTERNAL_SECRET} hibernate-orm: schema-management: strategy: update @@ -61,4 +63,17 @@ nowchess: jwt: sign: key: - location: ${JWT_PRIVATE_KEY_PATH:keys/private.pem} \ No newline at end of file + location: ${JWT_PRIVATE_KEY_PATH:keys/private.pem} +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/bot-platform/src/main/resources/application.yml b/modules/bot-platform/src/main/resources/application.yml index 8367882..bbbc737 100644 --- a/modules/bot-platform/src/main/resources/application.yml +++ b/modules/bot-platform/src/main/resources/application.yml @@ -22,3 +22,17 @@ nowchess: host: ${REDIS_HOST:localhost} port: ${REDIS_PORT:6379} prefix: ${REDIS_PREFIX:nowchess} + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/coordinator/src/main/resources/application.yml b/modules/coordinator/src/main/resources/application.yml index 83d3d87..0593056 100644 --- a/modules/coordinator/src/main/resources/application.yml +++ b/modules/coordinator/src/main/resources/application.yml @@ -25,7 +25,8 @@ nowchess: host: ${REDIS_HOST:localhost} port: ${REDIS_PORT:6379} prefix: ${REDIS_PREFIX:nowchess} - + internal: + secret: ${INTERNAL_SECRET:123abc} coordinator: max-games-per-core: 500 max-deviation-percent: 20 @@ -50,3 +51,17 @@ nowchess: quarkus: log: level: DEBUG + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/core/src/main/resources/application.yml b/modules/core/src/main/resources/application.yml index fe9f259..8b48e51 100644 --- a/modules/core/src/main/resources/application.yml +++ b/modules/core/src/main/resources/application.yml @@ -24,9 +24,8 @@ nowchess: host: localhost port: 6379 prefix: nowchess - internal: - secret: 123abc + secret: ${INTERNAL_SECRET:123abc} coordinator: enabled: ${NOWCHESS_COORDINATOR_ENABLED:false} @@ -111,3 +110,17 @@ nowchess: stream-heartbeat-interval: 200ms redis-heartbeat-interval: 2s instance-id: ${HOSTNAME:local}-${quarkus.uuid} + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/core/src/main/resources/import.sql b/modules/core/src/main/resources/import.sql deleted file mode 100644 index 16aa523..0000000 --- a/modules/core/src/main/resources/import.sql +++ /dev/null @@ -1,6 +0,0 @@ --- This file allow to write SQL commands that will be emitted in test and dev. --- The commands are commented as their support depends of the database --- insert into myentity (id, field) values(1, 'field-1'); --- insert into myentity (id, field) values(2, 'field-2'); --- insert into myentity (id, field) values(3, 'field-3'); --- alter sequence myentity_seq restart with 4; \ No newline at end of file diff --git a/modules/io/src/main/resources/application.yml b/modules/io/src/main/resources/application.yml index 199f62b..9e1ebb2 100644 --- a/modules/io/src/main/resources/application.yml +++ b/modules/io/src/main/resources/application.yml @@ -9,7 +9,7 @@ quarkus: nowchess: internal: - secret: 123abc + secret: ${INTERNAL_SECRET:123abc} smallrye-openapi: info-title: NowChess IO Service info-version: 1.0.0 @@ -18,3 +18,17 @@ nowchess: swagger-ui: always-include: true path: /swagger-ui + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/official-bots/src/main/resources/META-INF.native-image.de.nowchess.bot/reachability-metadata.json b/modules/official-bots/src/main/resources/META-INF/native-image/de/nowchess/official-bots/reachability-metadata.json similarity index 100% rename from modules/official-bots/src/main/resources/META-INF.native-image.de.nowchess.bot/reachability-metadata.json rename to modules/official-bots/src/main/resources/META-INF/native-image/de/nowchess/official-bots/reachability-metadata.json diff --git a/modules/official-bots/src/main/resources/application.yml b/modules/official-bots/src/main/resources/application.yml index 42b63f1..b7f65c0 100644 --- a/modules/official-bots/src/main/resources/application.yml +++ b/modules/official-bots/src/main/resources/application.yml @@ -22,3 +22,17 @@ nowchess: host: ${REDIS_HOST:localhost} port: ${REDIS_PORT:6379} prefix: ${REDIS_PREFIX:nowchess} + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/rule/src/main/resources/application.yml b/modules/rule/src/main/resources/application.yml index faa605e..3a1c077 100644 --- a/modules/rule/src/main/resources/application.yml +++ b/modules/rule/src/main/resources/application.yml @@ -9,4 +9,18 @@ quarkus: nowchess: internal: - secret: 123abc + secret: ${INTERNAL_SECRET:123abc} + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/store/src/main/resources/application.yml b/modules/store/src/main/resources/application.yml index badc025..08a995a 100644 --- a/modules/store/src/main/resources/application.yml +++ b/modules/store/src/main/resources/application.yml @@ -22,6 +22,8 @@ nowchess: host: ${REDIS_HOST:localhost} port: ${REDIS_PORT:6379} prefix: ${REDIS_PREFIX:nowchess} + internal: + secret: ${INTERNAL_SECRET:123abc} "%test": quarkus: @@ -39,3 +41,17 @@ nowchess: host: localhost port: 6379 prefix: test-store + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN diff --git a/modules/ws/src/main/resources/application.yml b/modules/ws/src/main/resources/application.yml index ac82f36..d596bd1 100644 --- a/modules/ws/src/main/resources/application.yml +++ b/modules/ws/src/main/resources/application.yml @@ -11,6 +11,8 @@ nowchess: host: localhost port: 6379 prefix: nowchess + internal: + secret: ${INTERNAL_SECRET:123abc} "%dev": nowchess: @@ -37,3 +39,17 @@ nowchess: publickey: location: ${JWT_PUBLIC_KEY_PATH:keys/public.pem} issuer: nowchess + +"%staging": + quarkus: + swagger-ui: + always-include: true + dev-ui: + always-include: true + log: + level: INFO + +"%production": + quarkus: + log: + level: WARN