mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[PM-2444] Add Pipeline for Testing All Database Variants in CI (#2471)
* Add Pipeline * Fix Lint * Added a Change * Update Pipeline * Add Multi-Version Support * Use Profile Switch for each profile * Fix MySql * Debug MySql * Use Proper Seperator * Add Allow User Variables=true * Pipeline Work * Expand Config for Postgres * Change Config Key * Add Debug Step * Fix Debug Step * Fix Tests * Add Sleep * Fix Tests * Fix SQL Server Tests * Add Sqlite * Use Context Property * Fix Tests * Fix Test Logger * Update AccountRevisionDate Check * Fix Postgres Time Issues * Formatting and Pipeline Update * Remove Unneeded SqlServer Setting * Update .github/workflows/infrastructure-tests.yml Co-authored-by: mimartin12 <77340197+mimartin12@users.noreply.github.com> --------- Co-authored-by: mimartin12 <77340197+mimartin12@users.noreply.github.com>
This commit is contained in:
@ -7,15 +7,20 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Bit.MySqlMigrations;
|
||||
|
||||
public static class GlobalSettingsFactory
|
||||
public class GlobalSettingsFactory
|
||||
{
|
||||
public static GlobalSettings GlobalSettings { get; } = new GlobalSettings();
|
||||
static GlobalSettingsFactory()
|
||||
public GlobalSettings GlobalSettings { get; }
|
||||
|
||||
public GlobalSettingsFactory(string[] args)
|
||||
{
|
||||
GlobalSettings = new GlobalSettings();
|
||||
// UserSecretsId here should match what is in Api.csproj
|
||||
var configBuilder = new ConfigurationBuilder().AddUserSecrets("bitwarden-Api");
|
||||
var Configuration = configBuilder.Build();
|
||||
ConfigurationBinder.Bind(Configuration.GetSection("GlobalSettings"), GlobalSettings);
|
||||
var config = new ConfigurationBuilder()
|
||||
.AddUserSecrets("bitwarden-Api")
|
||||
.AddCommandLine(args)
|
||||
.Build();
|
||||
|
||||
config.GetSection("GlobalSettings").Bind(GlobalSettings);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,7 +32,9 @@ public class DatabaseContextFactory : IDesignTimeDbContextFactory<DatabaseContex
|
||||
services.AddDataProtection();
|
||||
var serviceProvider = services.BuildServiceProvider();
|
||||
|
||||
var globalSettings = GlobalSettingsFactory.GlobalSettings;
|
||||
var globalSettings = new GlobalSettingsFactory(args)
|
||||
.GlobalSettings;
|
||||
|
||||
var optionsBuilder = new DbContextOptionsBuilder<DatabaseContext>();
|
||||
var connectionString = globalSettings.MySql?.ConnectionString;
|
||||
if (string.IsNullOrWhiteSpace(connectionString))
|
||||
|
Reference in New Issue
Block a user