#!/bin/sh if [ -f "./appsettings.json" ]; then sed -i -e '/\(DatabaseSettings\|Alexis.*Database\)"/, /}/ s/"Server".*/"Server": "dockerdb"\,/' \ -e '/ReadWriteDatabaseSettings"/, /}/ s/"Database": "AlexisHotWrite".*/"Database": "AlexisReadWrite"\,/' \ -e '/ReadWriteDatabaseSettings"/, /}/ s/"Database": "AlexisColdWrite".*/"Database": "Tier2"\,/' \ -e '/\(DatabaseSettings\|Alexis.*Database\)"/, /}/ {/"AlexisReadWrite/! s/"Database": "Alexis.*/"Database": "AlexisPTSTest"\,/}' \ -e '/\(DatabaseSettings\|Alexis.*Database\)"/, /}/ s/"UserId".*/"UserId": "gpspl"\,/' \ -e '/\(DatabaseSettings\|Alexis.*Database\)"/, /}/ s/"Password".*/"Password": "yW2S6KXdY8"\,/' \ -e '/"AlexisTokenDatabase"/, /}/ s/"Database".*/"Database": "AlexisPTSTokenTest"\,/' \ -e '/"AlexisSecureDatabase"/, /}/ s/"Database".*/"Database": "AlexisSecure"\,/' \ -e '/"MessageBroker"/, /}/ s/localhost/rabbitmq/' \ -e '/"HealthChecks"/, /}/ s,https://localhost:5091,http://dalapi:5090,' \ -e '/"DataAccessLayerApiUrl"/ s/localhost/dalapi/' \ -e '/"LoggingMinResultCount"/ s/:.*/: -1,/' \ -e '/"LoggingMinQueryTimeInMs"/ s/:.*/: -1,/' \ -e '/"TcRecordTablesTestingMode"/ s/true/false/' \ -e '/ConnectionString"/ s/Server=./Server=dockerdb/' \ -e '/ConnectionString"/ s/Password=;/Password=yW2S6KXdY8;/' \ -e '/[Cc]:/ s/\\\\/\\/g;s/\\/\//g;s/[Cc]://' \ -e '/"[Pp]ath"/ s:\\\\:/:g' \ -e '/"StatusWatcherSettings"/, /}/ s/"Frequency".*/"Frequency": "1000"\,/' \ -e '/"StatusWatcherSettings"/, /}/ s|https://localhost:44307|http://alexisapi|' \ -e '/"\(Authority\|RedirectTarget\)":/ s|https://.*"|http://secureapi"|' \ -e '/Api.*": {/, /}/ s|https://localhost:44320|http://secureapi|' \ -e '/Api.*": {/, /}/ s|https://localhost:44307|http://alexisapi|' \ -e 's,\(http\|https\)://localhost:9099,http://ratesapi:9099,' \ -e 's,\(http\|https\)://localhost:500[34],http://providerapi,' \ -e '/"Certificate": {/, /}/ d' \ -e 's|"Url": "http://localhost:63831"|"Url": "http://+:80"|' \ -e 's|"Url": "https://localhost:44307"|"Url": "https://+:443"|' \ -e 's/"\S*:6379/"redis:6379/' \ -e 's/"\S*:5672/"rabbitmq:5672/' \ -e '/"AuthorisationLoadOptions"/, /}/ s/"NewestAuthorisationCutoffInSeconds".*/"NewestAuthorisationCutoffInSeconds": "-3600"\,/' \ -e '/"AuthorisationLoadOptions"/, /}/ s/"MinimumTimeBetweenAuthLoadsInSeconds".*/"MinimumTimeBetweenAuthLoadsInSeconds": "-1"\,/' \ -e '/"Flags"/, /}/ s/"PanHsmPercent".*/"PanHsmPercent": 0\,/' \ -e '/"Flags"/, /}/ s/"PersonalIdNumberHsmPercent".*/"PersonalIdNumberHsmPercent": 0\,/' \ -e '/"WriteTo": \[$/, /\]/ {/.*"Name":.*"Console"/ d}' \ -e '/"WriteTo": \[$/ a \{ "Name": "Console" }, ' \ ./appsettings*.json fi if [ $USE_SEQ = "1" ]; then sed -i -e '/"WriteTo":/,/]\(,\|$\)/ c "WriteTo": \[ { "Name": "Console" },\n { "Name": "Seq", "Args": { "serverUrl": "http://seq", "compact": true, "apiKey" :"m3h0gDAj3kh7XVbNwmkX" } }],' \ ./appsettings*.json fi if [ -f "./hosting.json" ]; then sed -i -e '/"Certificate": {/, /}/ d' hosting.json fi if [ -f "./Extensions/ServiceCollectionExtensions.cs" ]; then sed -i -e 's|C:\\|/|' ./Extensions/ServiceCollectionExtensions.cs fi if [ -f "./Startup.cs" ]; then sed -i 's|app.UseHttpsRedirection|//// app.UseHttpsRedirection|' ./Startup.cs fi if [ -f "../GPS.API.SecureHSM/Commands/HsmCommandBase.cs" ]; then sed -i 's/? true : null/? (bool?)true : null/' ../GPS.API.SecureHSM/Commands/HsmCommandBase.cs fi if [ -f "../GPS.Currency.Common/Helpers/SqlDatabaseHelper.cs" ]; then sed -i 's/CommandType.StoredProcedure : null/CommandType.StoredProcedure : (CommandType?)null/' ../GPS.Currency.Common/Helpers/SqlDatabaseHelper.cs fi if [[ $DOTNET_VERSION == 5* ]]; then sed -i -e 's/netcoreapp3.1/net5.0/' *.csproj elif [[ $DOTNET_VERSION == 6* ]]; then sed -i -e 's/netcoreapp3.1/net6.0/' *.csproj fi sed -i -e "/\n&/' \ *.csproj fi