From efeebd85dad2c1641518d7875ab4247d7a69b33e Mon Sep 17 00:00:00 2001 From: Pooria Shariatzadeh Date: Wed, 20 May 2026 16:36:00 +0330 Subject: [PATCH] 2.0.0 --- CI_CHECKLIST.md | 20 --- DevOpsPackageTest/Class1.cs | 4 +- DevOpsPackageTest/DevOpsPackageTest.csproj | 9 +- DevOpsTest.csproj | 9 - DevOpsTest.sln | 31 ---- DevOpsTest.slnx | 5 + .../DevOpsTest.Client.csproj | 16 ++ .../DevOpsTest.Client}/Pages/Counter.razor | 2 +- DevOpsTest/DevOpsTest.Client/Program.cs | 5 + .../DevOpsTest.Client}/_Imports.razor | 3 +- .../wwwroot/appsettings.Development.json | 0 .../wwwroot/appsettings.json | 8 + .../DevOpsTest/Components}/App.razor | 4 +- .../Components}/Layout/MainLayout.razor | 0 .../Components}/Layout/MainLayout.razor.css | 0 .../Components}/Layout/NavMenu.razor | 0 .../Components}/Layout/NavMenu.razor.css | 0 .../Components/Layout/ReconnectModal.razor | 31 ++++ .../Layout/ReconnectModal.razor.css | 157 ++++++++++++++++++ .../Components/Layout/ReconnectModal.razor.js | 63 +++++++ .../DevOpsTest/Components}/Pages/Error.razor | 0 .../DevOpsTest/Components}/Pages/Home.razor | 0 .../Components/Pages/NotFound.razor | 5 + .../Components}/Pages/Weather.razor | 2 +- .../DevOpsTest/Components}/Routes.razor | 2 +- .../DevOpsTest/Components/_Imports.razor | 12 ++ DevOpsTest/DevOpsTest/DevOpsTest.csproj | 15 ++ .../DevOpsTest/Program.cs | 17 +- .../DevOpsTest/Properties/launchSettings.json | 25 +++ .../DevOpsTest/appsettings.Development.json | 8 + .../DevOpsTest/appsettings.json | 0 .../DevOpsTest/wwwroot}/app.css | 0 .../DevOpsTest/wwwroot}/favicon.png | Bin Dockerfile | 25 --- Properties/launchSettings.json | 38 ----- 35 files changed, 372 insertions(+), 144 deletions(-) delete mode 100644 CI_CHECKLIST.md delete mode 100644 DevOpsTest.csproj delete mode 100644 DevOpsTest.sln create mode 100644 DevOpsTest.slnx create mode 100644 DevOpsTest/DevOpsTest.Client/DevOpsTest.Client.csproj rename {Components => DevOpsTest/DevOpsTest.Client}/Pages/Counter.razor (91%) create mode 100644 DevOpsTest/DevOpsTest.Client/Program.cs rename {Components => DevOpsTest/DevOpsTest.Client}/_Imports.razor (87%) rename appsettings.Development.json => DevOpsTest/DevOpsTest.Client/wwwroot/appsettings.Development.json (100%) create mode 100644 DevOpsTest/DevOpsTest.Client/wwwroot/appsettings.json rename {Components => DevOpsTest/DevOpsTest/Components}/App.razor (82%) rename {Components => DevOpsTest/DevOpsTest/Components}/Layout/MainLayout.razor (100%) rename {Components => DevOpsTest/DevOpsTest/Components}/Layout/MainLayout.razor.css (100%) rename {Components => DevOpsTest/DevOpsTest/Components}/Layout/NavMenu.razor (100%) rename {Components => DevOpsTest/DevOpsTest/Components}/Layout/NavMenu.razor.css (100%) create mode 100644 DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor create mode 100644 DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.css create mode 100644 DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.js rename {Components => DevOpsTest/DevOpsTest/Components}/Pages/Error.razor (100%) rename {Components => DevOpsTest/DevOpsTest/Components}/Pages/Home.razor (100%) create mode 100644 DevOpsTest/DevOpsTest/Components/Pages/NotFound.razor rename {Components => DevOpsTest/DevOpsTest/Components}/Pages/Weather.razor (96%) rename {Components => DevOpsTest/DevOpsTest/Components}/Routes.razor (56%) create mode 100644 DevOpsTest/DevOpsTest/Components/_Imports.razor create mode 100644 DevOpsTest/DevOpsTest/DevOpsTest.csproj rename Program.cs => DevOpsTest/DevOpsTest/Program.cs (56%) create mode 100644 DevOpsTest/DevOpsTest/Properties/launchSettings.json create mode 100644 DevOpsTest/DevOpsTest/appsettings.Development.json rename appsettings.json => DevOpsTest/DevOpsTest/appsettings.json (100%) rename {wwwroot => DevOpsTest/DevOpsTest/wwwroot}/app.css (100%) rename {wwwroot => DevOpsTest/DevOpsTest/wwwroot}/favicon.png (100%) delete mode 100644 Dockerfile delete mode 100644 Properties/launchSettings.json diff --git a/CI_CHECKLIST.md b/CI_CHECKLIST.md deleted file mode 100644 index 43fb80c..0000000 --- a/CI_CHECKLIST.md +++ /dev/null @@ -1,20 +0,0 @@ -# CI/CD Checklists - -## Can do in codebase - -- [x] Update Gitea release workflow to pack `DevOpsPackageTest/DevOpsPackageTest.csproj` -- [x] Update Gitea release workflow to restore/build/pack selected project paths only -- [x] Add Dockerfile for `DevOpsTest` -- [x] Add `.dockerignore` to keep build context clean -- [x] Add package metadata to `DevOpsPackageTest.csproj` - -## Cannot do from codebase alone - -- [ ] Create or verify Gitea repository secrets: `NUGET_API_KEY`, `HARBOR_USERNAME`, `HARBOR_PASSWORD` -- [ ] Create the actual Gitea release and confirm workflow triggers -- [ ] Confirm package upload success on `https://nuget.sabp.ir` -- [ ] Confirm Harbor project, credentials, and push permissions on `reg.sabp.ir` -- [ ] Confirm the published image is visible in Harbor and can be pulled by the production VM -- [ ] Run end-to-end smoke tests against the real registry and package server -- [ ] Validate the workflow against the real Gitea Actions runner environment - diff --git a/DevOpsPackageTest/Class1.cs b/DevOpsPackageTest/Class1.cs index 33c7b72..930d9fa 100644 --- a/DevOpsPackageTest/Class1.cs +++ b/DevOpsPackageTest/Class1.cs @@ -1,6 +1,4 @@ -using System; - -namespace DevOpsPackageTest +namespace DevOpsPackageTest { public class Class1 { diff --git a/DevOpsPackageTest/DevOpsPackageTest.csproj b/DevOpsPackageTest/DevOpsPackageTest.csproj index ffc7b52..b760144 100644 --- a/DevOpsPackageTest/DevOpsPackageTest.csproj +++ b/DevOpsPackageTest/DevOpsPackageTest.csproj @@ -1,14 +1,9 @@  - netstandard2.1 + net10.0 + enable enable - true - false - DevOpsPackageTest - SABP - DevOps package test project for SABP CI/CD validation. - git diff --git a/DevOpsTest.csproj b/DevOpsTest.csproj deleted file mode 100644 index a3a34b6..0000000 --- a/DevOpsTest.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net10.0 - enable - enable - - - diff --git a/DevOpsTest.sln b/DevOpsTest.sln deleted file mode 100644 index 0a2b9b8..0000000 --- a/DevOpsTest.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.14.36616.10 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevOpsTest", "DevOpsTest.csproj", "{F5CD1119-847D-4C65-B472-C34A25F778CB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevOpsPackageTest", "DevOpsPackageTest\DevOpsPackageTest.csproj", "{BFABC423-0F62-D597-5CE8-75498604700E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F5CD1119-847D-4C65-B472-C34A25F778CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5CD1119-847D-4C65-B472-C34A25F778CB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5CD1119-847D-4C65-B472-C34A25F778CB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5CD1119-847D-4C65-B472-C34A25F778CB}.Release|Any CPU.Build.0 = Release|Any CPU - {BFABC423-0F62-D597-5CE8-75498604700E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BFABC423-0F62-D597-5CE8-75498604700E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BFABC423-0F62-D597-5CE8-75498604700E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BFABC423-0F62-D597-5CE8-75498604700E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7C317E50-4801-43A6-AE3F-9BEEBAC90F04} - EndGlobalSection -EndGlobal diff --git a/DevOpsTest.slnx b/DevOpsTest.slnx new file mode 100644 index 0000000..db58d20 --- /dev/null +++ b/DevOpsTest.slnx @@ -0,0 +1,5 @@ + + + + + diff --git a/DevOpsTest/DevOpsTest.Client/DevOpsTest.Client.csproj b/DevOpsTest/DevOpsTest.Client/DevOpsTest.Client.csproj new file mode 100644 index 0000000..136877c --- /dev/null +++ b/DevOpsTest/DevOpsTest.Client/DevOpsTest.Client.csproj @@ -0,0 +1,16 @@ + + + + net10.0 + enable + enable + true + Default + true + + + + + + + diff --git a/Components/Pages/Counter.razor b/DevOpsTest/DevOpsTest.Client/Pages/Counter.razor similarity index 91% rename from Components/Pages/Counter.razor rename to DevOpsTest/DevOpsTest.Client/Pages/Counter.razor index 1a4f8e7..e7d4f94 100644 --- a/Components/Pages/Counter.razor +++ b/DevOpsTest/DevOpsTest.Client/Pages/Counter.razor @@ -1,5 +1,5 @@ @page "/counter" -@rendermode InteractiveServer +@rendermode InteractiveAuto Counter diff --git a/DevOpsTest/DevOpsTest.Client/Program.cs b/DevOpsTest/DevOpsTest.Client/Program.cs new file mode 100644 index 0000000..519269f --- /dev/null +++ b/DevOpsTest/DevOpsTest.Client/Program.cs @@ -0,0 +1,5 @@ +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; + +var builder = WebAssemblyHostBuilder.CreateDefault(args); + +await builder.Build().RunAsync(); diff --git a/Components/_Imports.razor b/DevOpsTest/DevOpsTest.Client/_Imports.razor similarity index 87% rename from Components/_Imports.razor rename to DevOpsTest/DevOpsTest.Client/_Imports.razor index 7a1b871..0860636 100644 --- a/Components/_Imports.razor +++ b/DevOpsTest/DevOpsTest.Client/_Imports.razor @@ -6,5 +6,4 @@ @using static Microsoft.AspNetCore.Components.Web.RenderMode @using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.JSInterop -@using DevOpsTest -@using DevOpsTest.Components +@using DevOpsTest.Client diff --git a/appsettings.Development.json b/DevOpsTest/DevOpsTest.Client/wwwroot/appsettings.Development.json similarity index 100% rename from appsettings.Development.json rename to DevOpsTest/DevOpsTest.Client/wwwroot/appsettings.Development.json diff --git a/DevOpsTest/DevOpsTest.Client/wwwroot/appsettings.json b/DevOpsTest/DevOpsTest.Client/wwwroot/appsettings.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DevOpsTest/DevOpsTest.Client/wwwroot/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Components/App.razor b/DevOpsTest/DevOpsTest/Components/App.razor similarity index 82% rename from Components/App.razor rename to DevOpsTest/DevOpsTest/Components/App.razor index e0ec05d..f0c1c1a 100644 --- a/Components/App.razor +++ b/DevOpsTest/DevOpsTest/Components/App.razor @@ -5,6 +5,7 @@ + @@ -15,7 +16,8 @@ - + + diff --git a/Components/Layout/MainLayout.razor b/DevOpsTest/DevOpsTest/Components/Layout/MainLayout.razor similarity index 100% rename from Components/Layout/MainLayout.razor rename to DevOpsTest/DevOpsTest/Components/Layout/MainLayout.razor diff --git a/Components/Layout/MainLayout.razor.css b/DevOpsTest/DevOpsTest/Components/Layout/MainLayout.razor.css similarity index 100% rename from Components/Layout/MainLayout.razor.css rename to DevOpsTest/DevOpsTest/Components/Layout/MainLayout.razor.css diff --git a/Components/Layout/NavMenu.razor b/DevOpsTest/DevOpsTest/Components/Layout/NavMenu.razor similarity index 100% rename from Components/Layout/NavMenu.razor rename to DevOpsTest/DevOpsTest/Components/Layout/NavMenu.razor diff --git a/Components/Layout/NavMenu.razor.css b/DevOpsTest/DevOpsTest/Components/Layout/NavMenu.razor.css similarity index 100% rename from Components/Layout/NavMenu.razor.css rename to DevOpsTest/DevOpsTest/Components/Layout/NavMenu.razor.css diff --git a/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor b/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor new file mode 100644 index 0000000..e740b0c --- /dev/null +++ b/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor @@ -0,0 +1,31 @@ + + + +
+ +

+ Rejoining the server... +

+

+ Rejoin failed... trying again in seconds. +

+

+ Failed to rejoin.
Please retry or reload the page. +

+ +

+ The session has been paused by the server. +

+

+ Failed to resume the session.
Please retry or reload the page. +

+ +
+
diff --git a/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.css b/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.css new file mode 100644 index 0000000..3ad3773 --- /dev/null +++ b/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.css @@ -0,0 +1,157 @@ +.components-reconnect-first-attempt-visible, +.components-reconnect-repeated-attempt-visible, +.components-reconnect-failed-visible, +.components-pause-visible, +.components-resume-failed-visible, +.components-rejoining-animation { + display: none; +} + +#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible, +#components-reconnect-modal.components-reconnect-show .components-rejoining-animation, +#components-reconnect-modal.components-reconnect-paused .components-pause-visible, +#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible, +#components-reconnect-modal.components-reconnect-retrying, +#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible, +#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation, +#components-reconnect-modal.components-reconnect-failed, +#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible { + display: block; +} + + +#components-reconnect-modal { + background-color: white; + width: 20rem; + margin: 20vh auto; + padding: 2rem; + border: 0; + border-radius: 0.5rem; + box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3); + opacity: 0; + transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete; + animation: components-reconnect-modal-fadeOutOpacity 0.5s both; + &[open] + +{ + animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s; + animation-fill-mode: both; +} + +} + +#components-reconnect-modal::backdrop { + background-color: rgba(0, 0, 0, 0.4); + animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out; + opacity: 1; +} + +@keyframes components-reconnect-modal-slideUp { + 0% { + transform: translateY(30px) scale(0.95); + } + + 100% { + transform: translateY(0); + } +} + +@keyframes components-reconnect-modal-fadeInOpacity { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@keyframes components-reconnect-modal-fadeOutOpacity { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +.components-reconnect-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 1rem; +} + +#components-reconnect-modal p { + margin: 0; + text-align: center; +} + +#components-reconnect-modal button { + border: 0; + background-color: #6b9ed2; + color: white; + padding: 4px 24px; + border-radius: 4px; +} + + #components-reconnect-modal button:hover { + background-color: #3b6ea2; + } + + #components-reconnect-modal button:active { + background-color: #6b9ed2; + } + +.components-rejoining-animation { + position: relative; + width: 80px; + height: 80px; +} + + .components-rejoining-animation div { + position: absolute; + border: 3px solid #0087ff; + opacity: 1; + border-radius: 50%; + animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite; + } + + .components-rejoining-animation div:nth-child(2) { + animation-delay: -0.5s; + } + +@keyframes components-rejoining-animation { + 0% { + top: 40px; + left: 40px; + width: 0; + height: 0; + opacity: 0; + } + + 4.9% { + top: 40px; + left: 40px; + width: 0; + height: 0; + opacity: 0; + } + + 5% { + top: 40px; + left: 40px; + width: 0; + height: 0; + opacity: 1; + } + + 100% { + top: 0px; + left: 0px; + width: 80px; + height: 80px; + opacity: 0; + } +} diff --git a/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.js b/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.js new file mode 100644 index 0000000..a44de78 --- /dev/null +++ b/DevOpsTest/DevOpsTest/Components/Layout/ReconnectModal.razor.js @@ -0,0 +1,63 @@ +// Set up event handlers +const reconnectModal = document.getElementById("components-reconnect-modal"); +reconnectModal.addEventListener("components-reconnect-state-changed", handleReconnectStateChanged); + +const retryButton = document.getElementById("components-reconnect-button"); +retryButton.addEventListener("click", retry); + +const resumeButton = document.getElementById("components-resume-button"); +resumeButton.addEventListener("click", resume); + +function handleReconnectStateChanged(event) { + if (event.detail.state === "show") { + reconnectModal.showModal(); + } else if (event.detail.state === "hide") { + reconnectModal.close(); + } else if (event.detail.state === "failed") { + document.addEventListener("visibilitychange", retryWhenDocumentBecomesVisible); + } else if (event.detail.state === "rejected") { + location.reload(); + } +} + +async function retry() { + document.removeEventListener("visibilitychange", retryWhenDocumentBecomesVisible); + + try { + // Reconnect will asynchronously return: + // - true to mean success + // - false to mean we reached the server, but it rejected the connection (e.g., unknown circuit ID) + // - exception to mean we didn't reach the server (this can be sync or async) + const successful = await Blazor.reconnect(); + if (!successful) { + // We have been able to reach the server, but the circuit is no longer available. + // We'll reload the page so the user can continue using the app as quickly as possible. + const resumeSuccessful = await Blazor.resumeCircuit(); + if (!resumeSuccessful) { + location.reload(); + } else { + reconnectModal.close(); + } + } + } catch (err) { + // We got an exception, server is currently unavailable + document.addEventListener("visibilitychange", retryWhenDocumentBecomesVisible); + } +} + +async function resume() { + try { + const successful = await Blazor.resumeCircuit(); + if (!successful) { + location.reload(); + } + } catch { + reconnectModal.classList.replace("components-reconnect-paused", "components-reconnect-resume-failed"); + } +} + +async function retryWhenDocumentBecomesVisible() { + if (document.visibilityState === "visible") { + await retry(); + } +} diff --git a/Components/Pages/Error.razor b/DevOpsTest/DevOpsTest/Components/Pages/Error.razor similarity index 100% rename from Components/Pages/Error.razor rename to DevOpsTest/DevOpsTest/Components/Pages/Error.razor diff --git a/Components/Pages/Home.razor b/DevOpsTest/DevOpsTest/Components/Pages/Home.razor similarity index 100% rename from Components/Pages/Home.razor rename to DevOpsTest/DevOpsTest/Components/Pages/Home.razor diff --git a/DevOpsTest/DevOpsTest/Components/Pages/NotFound.razor b/DevOpsTest/DevOpsTest/Components/Pages/NotFound.razor new file mode 100644 index 0000000..917ada1 --- /dev/null +++ b/DevOpsTest/DevOpsTest/Components/Pages/NotFound.razor @@ -0,0 +1,5 @@ +@page "/not-found" +@layout MainLayout + +

Not Found

+

Sorry, the content you are looking for does not exist.

\ No newline at end of file diff --git a/Components/Pages/Weather.razor b/DevOpsTest/DevOpsTest/Components/Pages/Weather.razor similarity index 96% rename from Components/Pages/Weather.razor rename to DevOpsTest/DevOpsTest/Components/Pages/Weather.razor index 381bbd2..f437e5e 100644 --- a/Components/Pages/Weather.razor +++ b/DevOpsTest/DevOpsTest/Components/Pages/Weather.razor @@ -18,7 +18,7 @@ else Date Temp. (C) - Temp. (F) + Temp. (F) Summary diff --git a/Components/Routes.razor b/DevOpsTest/DevOpsTest/Components/Routes.razor similarity index 56% rename from Components/Routes.razor rename to DevOpsTest/DevOpsTest/Components/Routes.razor index f756e19..1e8a229 100644 --- a/Components/Routes.razor +++ b/DevOpsTest/DevOpsTest/Components/Routes.razor @@ -1,4 +1,4 @@ - + diff --git a/DevOpsTest/DevOpsTest/Components/_Imports.razor b/DevOpsTest/DevOpsTest/Components/_Imports.razor new file mode 100644 index 0000000..5d39894 --- /dev/null +++ b/DevOpsTest/DevOpsTest/Components/_Imports.razor @@ -0,0 +1,12 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using DevOpsTest +@using DevOpsTest.Client +@using DevOpsTest.Components +@using DevOpsTest.Components.Layout diff --git a/DevOpsTest/DevOpsTest/DevOpsTest.csproj b/DevOpsTest/DevOpsTest/DevOpsTest.csproj new file mode 100644 index 0000000..1a07434 --- /dev/null +++ b/DevOpsTest/DevOpsTest/DevOpsTest.csproj @@ -0,0 +1,15 @@ + + + + net10.0 + enable + enable + true + + + + + + + + diff --git a/Program.cs b/DevOpsTest/DevOpsTest/Program.cs similarity index 56% rename from Program.cs rename to DevOpsTest/DevOpsTest/Program.cs index 1edcf2d..0796d7f 100644 --- a/Program.cs +++ b/DevOpsTest/DevOpsTest/Program.cs @@ -1,28 +1,35 @@ +using DevOpsTest.Client.Pages; using DevOpsTest.Components; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorComponents() - .AddInteractiveServerComponents(); + .AddInteractiveServerComponents() + .AddInteractiveWebAssemblyComponents(); var app = builder.Build(); // Configure the HTTP request pipeline. -if (!app.Environment.IsDevelopment()) +if (app.Environment.IsDevelopment()) +{ + app.UseWebAssemblyDebugging(); +} +else { app.UseExceptionHandler("/Error", createScopeForErrors: true); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } - +app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true); app.UseHttpsRedirection(); - app.UseAntiforgery(); app.MapStaticAssets(); app.MapRazorComponents() - .AddInteractiveServerRenderMode(); + .AddInteractiveServerRenderMode() + .AddInteractiveWebAssemblyRenderMode() + .AddAdditionalAssemblies(typeof(DevOpsTest.Client._Imports).Assembly); app.Run(); diff --git a/DevOpsTest/DevOpsTest/Properties/launchSettings.json b/DevOpsTest/DevOpsTest/Properties/launchSettings.json new file mode 100644 index 0000000..b243a08 --- /dev/null +++ b/DevOpsTest/DevOpsTest/Properties/launchSettings.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "http://localhost:5255", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:7089;http://localhost:5255", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } + } diff --git a/DevOpsTest/DevOpsTest/appsettings.Development.json b/DevOpsTest/DevOpsTest/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DevOpsTest/DevOpsTest/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/appsettings.json b/DevOpsTest/DevOpsTest/appsettings.json similarity index 100% rename from appsettings.json rename to DevOpsTest/DevOpsTest/appsettings.json diff --git a/wwwroot/app.css b/DevOpsTest/DevOpsTest/wwwroot/app.css similarity index 100% rename from wwwroot/app.css rename to DevOpsTest/DevOpsTest/wwwroot/app.css diff --git a/wwwroot/favicon.png b/DevOpsTest/DevOpsTest/wwwroot/favicon.png similarity index 100% rename from wwwroot/favicon.png rename to DevOpsTest/DevOpsTest/wwwroot/favicon.png diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 1115e21..0000000 --- a/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM mcr-mirror.liara.ir/dotnet/sdk:10.0 AS build -WORKDIR /src - -COPY DevOpsTest.csproj ./ -RUN dotnet restore DevOpsTest.csproj - -COPY . ./ -RUN dotnet publish DevOpsTest.csproj \ - --configuration Release \ - --no-restore \ - --output /app/publish \ - /p:UseAppHost=false - -FROM mcr-mirror.liara.ir/dotnet/aspnet:10.0 AS final -WORKDIR /app - -ENV ASPNETCORE_URLS=http://+:8080 \ - ASPNETCORE_ENVIRONMENT=Production - -EXPOSE 8080 - -COPY --from=build /app/publish ./ -ENTRYPOINT ["dotnet", "DevOpsTest.dll"] diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json deleted file mode 100644 index deddcbf..0000000 --- a/Properties/launchSettings.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "profiles": { - "http": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "http://localhost:5099" - }, - "https": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "https://localhost:7180;http://localhost:5099" - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - }, - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:59559/", - "sslPort": 44329 - } - } -} \ No newline at end of file