From 0042726cdbbbf2c65659e08e9bc2445d2e28e5ba Mon Sep 17 00:00:00 2001 From: MeysamMoghaddam <65253484+MeysamMoghaddam@users.noreply.github.com> Date: Tue, 7 Oct 2025 20:53:28 +0330 Subject: [PATCH] u --- .gitea/workflows/bogw-stage.yml | 46 +++++++++++++++++++ .../BackOffice.BFF.Domain.csproj | 2 +- src/BackOffice.BFF.WebApi/Program.cs | 4 +- src/BackOffice.BFF.WebApi/appsettings.json | 6 +-- .../BackOffice.BFF.Otp.Protobuf.csproj | 2 +- .../BackOffice.BFF.Package.Protobuf.csproj | 2 +- .../BackOffice.BFF.Role.Protobuf.csproj | 2 +- .../BackOffice.BFF.User.Protobuf.csproj | 2 +- ...BackOffice.BFF.UserAddress.Protobuf.csproj | 2 +- .../BackOffice.BFF.UserOrder.Protobuf.csproj | 2 +- .../BackOffice.BFF.UserRole.Protobuf.csproj | 2 +- 11 files changed, 56 insertions(+), 16 deletions(-) create mode 100644 .gitea/workflows/bogw-stage.yml diff --git a/.gitea/workflows/bogw-stage.yml b/.gitea/workflows/bogw-stage.yml new file mode 100644 index 0000000..91ae9c1 --- /dev/null +++ b/.gitea/workflows/bogw-stage.yml @@ -0,0 +1,46 @@ + +name: Push nuget and docker image Actions Workflow + +on: + push: + branches: + - stage +jobs: + Deploy: + runs-on: windows + steps: + - name: Checkout + uses: https://git.afrino.co/actions/checkout@v3 + - name: Setup dotnet + uses: https://git.afrino.co/actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + + - name: Remove Package Source + run: dotnet nuget remove source FourSat + continue-on-error: true + - name: Add Package Source + run: dotnet nuget add source --name FourSat --username systemuser --password sZSA7PTiv3pUSQZ https://git.afrino.co/api/packages/FourSat/nuget/index.json --store-password-in-clear-text + + - name: Install dependencies + run: dotnet restore ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj" + - name: Build + run: dotnet build ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj" --configuration Release --no-restore + - name: Test + run: dotnet test ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj" --no-restore --verbosity normal + - name: Recycle Apppool + run: | + & "C:\Windows\System32\inetsrv\appcmd.exe" recycle apppool /apppool.name:bogw.kbs1.ir + shell: powershell + - name: Stop Website + run: | + & "C:\Windows\System32\inetsrv\appcmd.exe" stop site /site.name:bogw.kbs1.ir + shell: powershell + - name: Publish + run: dotnet publish ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj" -c Release -o publish + - name: Copy Publish To IIS Directory + run: Get-ChildItem -Path "publish\*" | Copy-Item -Destination "E:\kbs1.ir\bogw.kbs1.ir\" -Recurse -Force + - name: Start Website + run: | + & "C:\Windows\System32\inetsrv\appcmd.exe" start site /site.name:bogw.kbs1.ir + shell: powershell diff --git a/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj b/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj index 099f95f..1ad5ef4 100644 --- a/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj +++ b/src/BackOffice.BFF.Domain/BackOffice.BFF.Domain.csproj @@ -11,7 +11,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BackOffice.BFF.WebApi/Program.cs b/src/BackOffice.BFF.WebApi/Program.cs index 7a4879c..4e3852f 100644 --- a/src/BackOffice.BFF.WebApi/Program.cs +++ b/src/BackOffice.BFF.WebApi/Program.cs @@ -1,12 +1,10 @@ using System.Reflection; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Server.Kestrel.Core; using Serilog; using Serilog.Core; -using Serilog.Sinks.MSSqlServer; using Microsoft.OpenApi.Models; var builder = WebApplication.CreateBuilder(args); @@ -23,7 +21,7 @@ if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) var levelSwitch = new LoggingLevelSwitch(); var logger = new LoggerConfiguration() .WriteTo.Seq("https://seq.afrino.co", - apiKey: "KWWhEFFuHMJFhX0dYvBD", + apiKey: "qPxY2VEQwMfWMI8IX4Fq", controlLevelSwitch: levelSwitch) .CreateLogger(); builder.Logging.AddSerilog(logger); diff --git a/src/BackOffice.BFF.WebApi/appsettings.json b/src/BackOffice.BFF.WebApi/appsettings.json index 5ca56b5..1df342f 100644 --- a/src/BackOffice.BFF.WebApi/appsettings.json +++ b/src/BackOffice.BFF.WebApi/appsettings.json @@ -9,13 +9,9 @@ "Protocols": "Http2" } }, - "ConnectionStrings": { - "LogConnection": "Data Source=.,2019; Initial Catalog=DBName;User ID=dbuser;Password=dbpassword;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False", - "providerName": "System.Data.SqlClient" - }, "GrpcChannelOptions": { "FMSMSAddress": "https://dl.afrino.co", - "CMSMSAddress": "https://localhost:32846" + "CMSMSAddress": "https://cms.kbs1.ir" }, "Authentication": { "Authority": "https://ids.domain.com/", diff --git a/src/Protobufs/BackOffice.BFF.Otp.Protobuf/BackOffice.BFF.Otp.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.Otp.Protobuf/BackOffice.BFF.Otp.Protobuf.csproj index 4aa3f56..7eb59bf 100644 --- a/src/Protobufs/BackOffice.BFF.Otp.Protobuf/BackOffice.BFF.Otp.Protobuf.csproj +++ b/src/Protobufs/BackOffice.BFF.Otp.Protobuf/BackOffice.BFF.Otp.Protobuf.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Protobufs/BackOffice.BFF.Package.Protobuf/BackOffice.BFF.Package.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.Package.Protobuf/BackOffice.BFF.Package.Protobuf.csproj index e24336e..b7a3b8f 100644 --- a/src/Protobufs/BackOffice.BFF.Package.Protobuf/BackOffice.BFF.Package.Protobuf.csproj +++ b/src/Protobufs/BackOffice.BFF.Package.Protobuf/BackOffice.BFF.Package.Protobuf.csproj @@ -15,7 +15,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Protobufs/BackOffice.BFF.Role.Protobuf/BackOffice.BFF.Role.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.Role.Protobuf/BackOffice.BFF.Role.Protobuf.csproj index bf92293..bc6c936 100644 --- a/src/Protobufs/BackOffice.BFF.Role.Protobuf/BackOffice.BFF.Role.Protobuf.csproj +++ b/src/Protobufs/BackOffice.BFF.Role.Protobuf/BackOffice.BFF.Role.Protobuf.csproj @@ -15,7 +15,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Protobufs/BackOffice.BFF.User.Protobuf/BackOffice.BFF.User.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.User.Protobuf/BackOffice.BFF.User.Protobuf.csproj index 1aceb62..e0da992 100644 --- a/src/Protobufs/BackOffice.BFF.User.Protobuf/BackOffice.BFF.User.Protobuf.csproj +++ b/src/Protobufs/BackOffice.BFF.User.Protobuf/BackOffice.BFF.User.Protobuf.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Protobufs/BackOffice.BFF.UserAddress.Protobuf/BackOffice.BFF.UserAddress.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.UserAddress.Protobuf/BackOffice.BFF.UserAddress.Protobuf.csproj index 0d3cafc..4b326c4 100644 --- a/src/Protobufs/BackOffice.BFF.UserAddress.Protobuf/BackOffice.BFF.UserAddress.Protobuf.csproj +++ b/src/Protobufs/BackOffice.BFF.UserAddress.Protobuf/BackOffice.BFF.UserAddress.Protobuf.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Protobufs/BackOffice.BFF.UserOrder.Protobuf/BackOffice.BFF.UserOrder.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.UserOrder.Protobuf/BackOffice.BFF.UserOrder.Protobuf.csproj index 21a55c3..9f316d9 100644 --- a/src/Protobufs/BackOffice.BFF.UserOrder.Protobuf/BackOffice.BFF.UserOrder.Protobuf.csproj +++ b/src/Protobufs/BackOffice.BFF.UserOrder.Protobuf/BackOffice.BFF.UserOrder.Protobuf.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Protobufs/BackOffice.BFF.UserRole.Protobuf/BackOffice.BFF.UserRole.Protobuf.csproj b/src/Protobufs/BackOffice.BFF.UserRole.Protobuf/BackOffice.BFF.UserRole.Protobuf.csproj index 707c512..60ef695 100644 --- a/src/Protobufs/BackOffice.BFF.UserRole.Protobuf/BackOffice.BFF.UserRole.Protobuf.csproj +++ b/src/Protobufs/BackOffice.BFF.UserRole.Protobuf/BackOffice.BFF.UserRole.Protobuf.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all