mirror of
https://github.com/bitwarden/server.git
synced 2025-05-18 01:55:37 -05:00
Add MariaDB as development and test database (#5816)
This commit is contained in:
parent
bbbc7a6422
commit
3bf4f11c3a
@ -11,6 +11,7 @@ MAILCATCHER_PORT=1080
|
||||
# Alternative databases
|
||||
POSTGRES_PASSWORD=SET_A_PASSWORD_HERE_123
|
||||
MYSQL_ROOT_PASSWORD=SET_A_PASSWORD_HERE_123
|
||||
MARIADB_ROOT_PASSWORD=SET_A_PASSWORD_HERE_123
|
||||
|
||||
# IdP configuration
|
||||
# Complete using the values from the Manage SSO page in the web vault
|
||||
|
@ -70,6 +70,20 @@ services:
|
||||
profiles:
|
||||
- mysql
|
||||
|
||||
mariadb:
|
||||
image: mariadb:10
|
||||
ports:
|
||||
- 4306:3306
|
||||
environment:
|
||||
MARIADB_USER: maria
|
||||
MARIADB_PASSWORD: ${MARIADB_ROOT_PASSWORD}
|
||||
MARIADB_DATABASE: vault_dev
|
||||
MARIADB_RANDOM_ROOT_PASSWORD: "true"
|
||||
volumes:
|
||||
- mariadb_dev_data:/var/lib/mysql
|
||||
profiles:
|
||||
- mariadb
|
||||
|
||||
idp:
|
||||
image: kenchan0130/simplesamlphp:1.19.8
|
||||
container_name: idp
|
||||
|
@ -5,6 +5,7 @@ param(
|
||||
[switch]$all,
|
||||
[switch]$postgres,
|
||||
[switch]$mysql,
|
||||
[switch]$mariadb,
|
||||
[switch]$mssql,
|
||||
[switch]$sqlite,
|
||||
[switch]$selfhost,
|
||||
@ -15,11 +16,15 @@ param(
|
||||
$ErrorActionPreference = "Stop"
|
||||
$currentDir = Get-Location
|
||||
|
||||
if (!$all -and !$postgres -and !$mysql -and !$sqlite) {
|
||||
function Get-IsEFDatabase {
|
||||
return $postgres -or $mysql -or $mariadb -or $sqlite;
|
||||
}
|
||||
|
||||
if (!$all -and !$(Get-IsEFDatabase)) {
|
||||
$mssql = $true;
|
||||
}
|
||||
|
||||
if ($all -or $postgres -or $mysql -or $sqlite) {
|
||||
if ($all -or $(Get-IsEFDatabase)) {
|
||||
dotnet ef *> $null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Entity Framework Core tools were not found in the dotnet global tools. Attempting to install"
|
||||
@ -60,9 +65,12 @@ if ($all -or $mssql) {
|
||||
}
|
||||
|
||||
Foreach ($item in @(
|
||||
@($mysql, "MySQL", "MySqlMigrations", "mySql", 2),
|
||||
@($postgres, "PostgreSQL", "PostgresMigrations", "postgreSql", 0),
|
||||
@($sqlite, "SQLite", "SqliteMigrations", "sqlite", 1)
|
||||
@($sqlite, "SQLite", "SqliteMigrations", "sqlite", 1),
|
||||
@($mysql, "MySQL", "MySqlMigrations", "mySql", 2),
|
||||
# MariaDB shares the MySQL connection string in the server config so they are mutually exclusive in that context.
|
||||
# However they can still be run independently for integration tests.
|
||||
@($mariadb, "MariaDB", "MySqlMigrations", "mySql", 3)
|
||||
)) {
|
||||
if (!$item[0] -and !$all) {
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user