-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ability to switch database backends
Former-commit-id: d5595768a00fe18cb7df74399cafb0ee307a9eaf
- Loading branch information
Showing
11 changed files
with
181 additions
and
23 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
testbed/smoke-test/db_configs/mariadb.docker-compose.override.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| services: | ||
| database: | ||
| image: mariadb | ||
| environment: | ||
| MYSQL_DATABASE: shibui | ||
| MYSQL_USER: shibui | ||
| MYSQL_PASSWORD: shibui | ||
| MYSQL_ROOT_PASSWORD: root | ||
| healthcheck: | ||
| test: mysql -u shibui --password=shibui shibui -e "select 1" | ||
| interval: 5s | ||
| retries: 5 | ||
| start_period: 5s | ||
| timeout: 10s | ||
| shib-idp-ui: | ||
| depends_on: | ||
| database: | ||
| condition: service_healthy | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| spring: | ||
| profiles: | ||
| include: | ||
| datasource: | ||
| platform: mysql | ||
| driver-class-name: com.mariadb.jdbc.Driver | ||
| url: jdbc:mariadb://database:3306/shibui | ||
| username: shibui | ||
| password: shibui | ||
| jpa: | ||
| properties: | ||
| hibernate: | ||
| dialect: org.hibernate.dialect.MariaDB103Dialect |
19 changes: 19 additions & 0 deletions
19
testbed/smoke-test/db_configs/mysql.docker-compose.override.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| services: | ||
| database: | ||
| image: mysql | ||
| environment: | ||
| MYSQL_DATABASE: shibui | ||
| MYSQL_USER: shibui | ||
| MYSQL_PASSWORD: shibui | ||
| MYSQL_ROOT_PASSWORD: root | ||
| healthcheck: | ||
| test: mysql -u shibui --password=shibui shibui -e "select 1" | ||
| interval: 5s | ||
| retries: 5 | ||
| start_period: 5s | ||
| timeout: 10s | ||
| shib-idp-ui: | ||
| depends_on: | ||
| database: | ||
| condition: service_healthy | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| spring: | ||
| profiles: | ||
| include: | ||
| datasource: | ||
| platform: mysql | ||
| driver-class-name: com.mysql.cj.jdbc.Driver | ||
| url: jdbc:mysql://database:3306/shibui | ||
| username: shibui | ||
| password: shibui | ||
| jpa: | ||
| properties: | ||
| hibernate: | ||
| dialect: org.hibernate.dialect.MySQL8Dialect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| spring: | ||
| profiles: | ||
| include: | ||
| datasource: | ||
| platform: postgres | ||
| driver-class-name: org.postgresql.Driver | ||
| url: jdbc:postgresql://database:5432/shibui | ||
| username: shibui | ||
| password: shibui | ||
| jpa: | ||
| properties: | ||
| hibernate: | ||
| dialect: org.hibernate.dialect.PostgreSQLDialect |
17 changes: 17 additions & 0 deletions
17
testbed/smoke-test/db_configs/sqlServer.docker-compose.override.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| services: | ||
| database: | ||
| build: | ||
| context: ../sqlServer | ||
| dockerfile: ../sqlServer/docker/Dockerfile | ||
| image: smoke-test_database | ||
| # healthcheck: | ||
| # test: mysql -u shibui --password=shibui shibui -e "select 1" | ||
| # interval: 5s | ||
| # retries: 5 | ||
| # start_period: 5s | ||
| # timeout: 10s | ||
| # shib-idp-ui: | ||
| # depends_on: | ||
| # database: | ||
| # condition: service_healthy | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| spring: | ||
| profiles: | ||
| include: | ||
| datasource: | ||
| platform: sqlserver | ||
| driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | ||
| url: jdbc:sqlserver://database:1433 | ||
| username: sa | ||
| password: Password1 | ||
| jpa: | ||
| properties: | ||
| hibernate: | ||
| dialect: org.hibernate.dialect.SQLServerDialect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
|
|
||
| DB=$1 | ||
|
|
||
| if [[ ! "$DB" =~ ^(postgres|mariadb|mysql|sqlServer)$ ]]; | ||
| then | ||
| echo "argument mst be one of: postgres mariadb mysql sqlServer" | ||
| exit 0; | ||
| fi | ||
|
|
||
| if [[ $DB == "postgres" ]]; | ||
| then | ||
| rm -f docker-compose.override.yml | ||
| else | ||
| rm -f docker-compose.override.yml | ||
| ln -s db_configs/$DB.docker-compose.override.yml docker-compose.override.yml | ||
| fi | ||
|
|
||
| rm -f shibui/application.yml | ||
| cat shibui/application.yml.nodb db_configs/$DB.yml >> shibui/application.yml | ||
|
|
||
| echo "shibui will now use the $DB container" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| server: | ||
| forward-headers-strategy: NATIVE | ||
| shibui: | ||
| default-password: "{noop}letmein7" | ||
| metadata-dir: /var/shibboleth/dynamic_metadata | ||
| metadataProviders: | ||
| target: file:/var/shibboleth/dynamic_config/metadata-providers.xml | ||
| user-bootstrap-resource: file:/conf/users.csv | ||
| roles: ROLE_ADMIN,ROLE_NONE,ROLE_USER,ROLE_ENABLE,ROLE_PONY | ||
| pac4j-enabled: true | ||
| pac4j: | ||
| keystorePath: "/conf/samlKeystore.jks" | ||
| keystorePassword: "changeit" | ||
| privateKeyPassword: "changeit" | ||
| serviceProviderEntityId: "https://unicon.net/test/shibui" | ||
| serviceProviderMetadataPath: "/conf/sp-metadata.xml" | ||
| identityProviderMetadataPath: "/conf/idp-metadata.xml" | ||
| forceServiceProviderMetadataGeneration: true | ||
| callbackUrl: "https://shibui.unicon.local/callback" | ||
| maximumAuthenticationLifetime: 3600000 | ||
| simpleProfileMapping: | ||
| username: urn:oid:0.9.2342.19200300.100.1.1 | ||
| firstName: urn:oid:2.5.4.42 | ||
| lastName: urn:oid:2.5.4.4 | ||
| email: urn:oid:0.9.2342.19200300.100.1.3 | ||
| groups: urn:oid:2.5.4.15 # businessCategory | ||
| roles: urn:oid:1.3.6.1.4.1.5923.1.1.1.7 # eduPersonEntitlement |