From 77f16b55e18a9105ad97fc35b11cee7ea87690e9 Mon Sep 17 00:00:00 2001 From: anjoy8 <3143422472@qq.com> Date: Sun, 26 Feb 2023 18:32:49 +0800 Subject: [PATCH] feat: :flipper: update publish linux sh --- Blog.Core.Build.bat | 1 - Blog.Core.Gateway/Program.cs | 4 +++- ...tings.Development.json => appsettings.gw.Development.json} | 0 Blog.Core.Gateway/{appsettings.json => appsettings.gw.json} | 0 Blog.Core.Publish.Linux.sh | 3 ++- 5 files changed, 5 insertions(+), 3 deletions(-) rename Blog.Core.Gateway/{appsettings.Development.json => appsettings.gw.Development.json} (100%) rename Blog.Core.Gateway/{appsettings.json => appsettings.gw.json} (100%) diff --git a/Blog.Core.Build.bat b/Blog.Core.Build.bat index 632e841..7d614aa 100644 --- a/Blog.Core.Build.bat +++ b/Blog.Core.Build.bat @@ -1,4 +1,3 @@ -git pull @echo off diff --git a/Blog.Core.Gateway/Program.cs b/Blog.Core.Gateway/Program.cs index 1ba4681..9c1ba1c 100644 --- a/Blog.Core.Gateway/Program.cs +++ b/Blog.Core.Gateway/Program.cs @@ -15,7 +15,9 @@ namespace Blog.Core.AdminMvc Host.CreateDefaultBuilder(args) .ConfigureAppConfiguration((hostingContext, config) => { - config.AddJsonFile("ocelot.json", optional: true, reloadOnChange: true) + config.AddJsonFile("appsettings.gw.json", optional: true, reloadOnChange: false) + .AddJsonFile($"appsettings.gw.{hostingContext.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: false) + .AddJsonFile("ocelot.json", optional: true, reloadOnChange: true) .AddJsonFile($"ocelot.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true); }) .ConfigureWebHostDefaults(webBuilder => diff --git a/Blog.Core.Gateway/appsettings.Development.json b/Blog.Core.Gateway/appsettings.gw.Development.json similarity index 100% rename from Blog.Core.Gateway/appsettings.Development.json rename to Blog.Core.Gateway/appsettings.gw.Development.json diff --git a/Blog.Core.Gateway/appsettings.json b/Blog.Core.Gateway/appsettings.gw.json similarity index 100% rename from Blog.Core.Gateway/appsettings.json rename to Blog.Core.Gateway/appsettings.gw.json diff --git a/Blog.Core.Publish.Linux.sh b/Blog.Core.Publish.Linux.sh index 05eb810..7599f20 100644 --- a/Blog.Core.Publish.Linux.sh +++ b/Blog.Core.Publish.Linux.sh @@ -1,8 +1,9 @@ -git pull; + find .PublishFiles/ -type f -and ! -path '*/wwwroot/images/*' ! -name 'appsettings.*' |xargs rm -rf dotnet build; rm -rf /home/Blog.Core/Blog.Core.Api/bin/Debug/.PublishFiles; dotnet publish -o /home/Blog.Core/Blog.Core.Api/bin/Debug/.PublishFiles; +rm -rf /home/Blog.Core/Blog.Core.Api/bin/Debug/.PublishFiles/WMBlog.db; # cp -r /home/Blog.Core/Blog.Core.Api/bin/Debug/.PublishFiles ./; awk 'BEGIN { cmd="cp -ri /home/Blog.Core/Blog.Core.Api/bin/Debug/.PublishFiles ./"; print "n" |cmd; }' echo "Successfully!!!! ^ please see the file .PublishFiles"; \ No newline at end of file