Skip to content

Commit

Permalink
configurable database hostname and port via environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JohT committed May 20, 2022
1 parent 495a77a commit 4b8759e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ jobs:

- name: Build with Maven, Test with PostgreSql
working-directory: showcase-quarkus-eventsourcing
run: mvn verify -Dquarkus.profile=postgres --file pom.xml --batch-mode
run: mvn verify -Dquarkus.profile=postgres --file pom.xml --batch-mode
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: postgres
# The default PostgreSQL port
POSTGRES_PORT: 5432
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ quarkus.flyway.locations=db/command/common,db/command/h2,db/query/common,db/quer

# H2 in-memory as default database e.g. for flyway
quarkus.datasource.db-kind=h2
quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:eventsourcing;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_UPPER=false
quarkus.datasource.jdbc.url=jdbc:h2:tcp://${H2_HOST:localhost}/mem:eventsourcing;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_UPPER=false
quarkus.datasource.username=sa
quarkus.datasource.password=sa
quarkus.datasource.jdbc.min-size=2
Expand All @@ -40,16 +40,16 @@ quarkus.datasource.jdbc.transactions=xa

# PostgreSql as default database e.g. for flyway (for quarkus.profile=postges)
%postgres.quarkus.datasource.db-kind=postgresql
%postgres.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres?stringtype=unspecified
%postgres.quarkus.datasource.jdbc.url=jdbc:postgresql://${POSTGRES_HOST:localhost}:${POSTGRES_PORT:5432}/postgres?stringtype=unspecified
%postgres.quarkus.datasource.username=postgres
%postgres.quarkus.datasource.password=
%postgres.quarkus.datasource.password=postgres
%postgres.quarkus.datasource.jdbc.max-size=8
%postgres.quarkus.datasource.jdbc.min-size=2
%postgres.quarkus.datasource.jdbc.transactions=xa

# H2 in-memory as messaging database
quarkus.datasource.messaging.db-kind=h2
quarkus.datasource.messaging.jdbc.url=jdbc:h2:tcp://localhost/mem:eventsourcing;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_UPPER=false
quarkus.datasource.messaging.jdbc.url=jdbc:h2:tcp://${H2_HOST:localhost}/mem:eventsourcing;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_UPPER=false
quarkus.datasource.messaging.username=sa
quarkus.datasource.messaging.password=sa
quarkus.datasource.messaging.jdbc.min-size=2
Expand All @@ -58,9 +58,9 @@ quarkus.datasource.messaging.jdbc.transactions=xa

# PostgreSql as messaging database (for quarkus.profile=postges)
%postgres.quarkus.datasource.messaging.db-kind=postgresql
%postgres.quarkus.datasource.messaging.jdbc.url=jdbc:postgresql://localhost:5432/postgres?stringtype=unspecified
%postgres.quarkus.datasource.messaging.jdbc.url=jdbc:postgresql://${POSTGRES_HOST:localhost}:${POSTGRES_PORT:5432}/postgres?stringtype=unspecified
%postgres.quarkus.datasource.messaging.username=postgres
%postgres.quarkus.datasource.messaging.password=
%postgres.quarkus.datasource.messaging.password=postgres
%postgres.quarkus.datasource.messaging.jdbc.min-size=2
%postgres.quarkus.datasource.messaging.jdbc.max-size=8
%postgres.quarkus.datasource.messaging.jdbc.transactions=xa
Expand Down

0 comments on commit 4b8759e

Please sign in to comment.