umbau auf enviroment appsettings
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m4s

This commit is contained in:
Tobias Wohlleben 2024-09-25 10:57:23 +02:00
parent 18fd6d6f59
commit 2b74f17012
19 changed files with 128 additions and 91 deletions

View File

@ -4,6 +4,14 @@
<selectionStates> <selectionStates>
<SelectionState runConfigName="RBLNews.Maui"> <SelectionState runConfigName="RBLNews.Maui">
<option name="selectionMode" value="DROPDOWN" /> <option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-09-25T07:14:40.138909900Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\tobia\.android\avd\pixel_5_-_api_34.avd" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState> </SelectionState>
</selectionStates> </selectionStates>
</component> </component>

View File

@ -1,4 +1,6 @@
using Microsoft.Maui.Controls.PlatformConfiguration; using Microsoft.Maui;
using Microsoft.Maui.Controls;
using RBLNews.Shared.Services; using RBLNews.Shared.Services;
namespace RBLNews.Maui namespace RBLNews.Maui

View File

@ -1,4 +1,8 @@
using RBLNews.Shared.Components.Pages; using System;
using Microsoft.Maui.Controls;
using RBLNews.Shared.Components.Pages;
namespace RBLNews.Maui namespace RBLNews.Maui
{ {

View File

@ -2,7 +2,10 @@
using CommunityToolkit.Maui.Markup; using CommunityToolkit.Maui.Markup;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Maui.Hosting;
using RBLNews.Maui.Services; using RBLNews.Maui.Services;
using RBLNews.Shared.Models; using RBLNews.Shared.Models;
@ -18,8 +21,8 @@ namespace RBLNews.Maui
var builder = MauiApp.CreateBuilder(); var builder = MauiApp.CreateBuilder();
builder builder
.UseMauiApp<App>() .UseMauiApp<App>()
.UseMauiCommunityToolkit() .UseMauiCommunityToolkit()
.UseMauiCommunityToolkitMarkup() .UseMauiCommunityToolkitMarkup()
.ConfigureFonts(fonts => .ConfigureFonts(fonts =>
{ {
//fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); //fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
@ -33,17 +36,17 @@ namespace RBLNews.Maui
builder.Services.AddSingleton<AppLifecycleService>(); builder.Services.AddSingleton<AppLifecycleService>();
#if DEBUG #if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools(); builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug(); builder.Logging.AddDebug();
#endif #endif
MauiApp app = builder.Build(); MauiApp app = builder.Build();
AppSettingsModel? appSettings = app.Configuration.GetSection("App").Get<AppSettingsModel>(); AppSettingsModel? appSettings = app.Configuration.GetSection("Logging").Get<AppSettingsModel>();
if (string.IsNullOrEmpty(appSettings?.BackendApiUrl)) if (string.IsNullOrEmpty(appSettings?.BackendApiUrl))
{ {
throw new Exception($"can't instantiate services, due to paramters are null. backendApiUrl: '{appSettings?.BackendApiUrl}'"); throw new Exception($"can't instantiate services, due to parameters are null. backendApiUrl: '{appSettings?.BackendApiUrl}'");
} }
return app; return app;

View File

@ -68,17 +68,39 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Remove="appsettings.Development.json" />
<Content Remove="appsettings.json" />
<Content Remove="appsettings.Production.json" />
<Content Remove="appsettings.Test.json" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="Resources\Fonts\NanumMyeongjo-Regular.ttf" /> <None Remove="Resources\Fonts\NanumMyeongjo-Regular.ttf" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="appsettings.Production.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="appsettings.Test.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Blazor.Bootstrap" Version="3.0.0" /> <PackageReference Include="Blazor.Bootstrap" Version="3.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.3" /> <PackageReference Include="CommunityToolkit.Maui" Version="9.0.3" />
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.1.0" /> <PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.1.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" /> <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.90" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" /> <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.90" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.90" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup> </ItemGroup>
@ -87,22 +109,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="IaC\" /> <Folder Include="obj\" />
</ItemGroup>
<ItemGroup>
<Content Include="..\RBLNews.Shared\wwwroot\appsettings.Development.json">
<Link>wwwroot\appsettings.Development.json</Link>
</Content>
<Content Include="..\RBLNews.Shared\wwwroot\appsettings.json">
<Link>wwwroot\appsettings.json</Link>
</Content>
<Content Include="..\RBLNews.Shared\wwwroot\appsettings.Production.json">
<Link>wwwroot\appsettings.Production.json</Link>
</Content>
<Content Include="..\RBLNews.Shared\wwwroot\appsettings.Test.json">
<Link>wwwroot\appsettings.Test.json</Link>
</Content>
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionRBLNewsMauiHideInfoBar="True" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionRBLNewsMauiHideInfoBar="True" /></VisualStudio></ProjectExtensions>

View File

@ -0,0 +1,11 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"App": {
"BackendApiUrl": "https://localhost:5147"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rblnews.de"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rbl.wohlleben.dev"
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@ -1,3 +0,0 @@
<div class="my-component">
This component is defined in the <strong>RBLNews.Shared</strong> library.
</div>

View File

@ -1,6 +0,0 @@
.my-component {
border: 2px dashed red;
padding: 1em;
margin: 1em 0;
background-image: url('background.png');
}

View File

@ -6,6 +6,22 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Remove="wwwroot\appsettings.Development.json" />
<Content Remove="wwwroot\appsettings.json" />
<Content Remove="wwwroot\appsettings.Production.json" />
<Content Remove="wwwroot\appsettings.Test.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="wwwroot\appsettings.Test.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup> <ItemGroup>
<SupportedPlatform Include="browser" /> <SupportedPlatform Include="browser" />
@ -21,18 +37,19 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="wwwroot\appsettings.json"> <Folder Include="obj\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </EmbeddedResource>
<Content Update="wwwroot\appsettings.Development.json"> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\appsettings.Production.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </EmbeddedResource>
<Content Update="wwwroot\appsettings.Production.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\appsettings.Test.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,26 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<<<<<<< HEAD
=======
<PackageReference Include="Blazor.Bootstrap" Version="3.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.3" />
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.1.0" />
>>>>>>> css_bootstrap_blazor
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="RBLFeederCommon" Version="1.0.0" />
</ItemGroup>
</Project>

View File

@ -1,4 +0,0 @@
@* ANT CSS DESIGN IMPORT -------------------- *@
@using AntDesign
@using Microsoft.AspNetCore.Components.Web

View File

@ -1 +0,0 @@
@using Microsoft.AspNetCore.Components.Web

View File

@ -1,4 +0,0 @@
@* ANT CSS DESIGN IMPORT -------------------- *@
@using BlazorBootstrap;
@using Microsoft.AspNetCore.Components.Web

View File

@ -1,8 +0,0 @@
<<<<<<< HEAD
@using Microsoft.AspNetCore.Components.Web
=======
@* ANT CSS DESIGN IMPORT -------------------- *@
@using BlazorBootstrap;
@using Microsoft.AspNetCore.Components.Web
>>>>>>> css_bootstrap_blazor

View File

@ -33,4 +33,8 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="obj\" />
</ItemGroup>
</Project> </Project>