From edb6d1ecd8601dcb2ddfea36b3195f96702e0ea4 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 21 Sep 2023 11:05:58 +0800 Subject: [PATCH] =?UTF-8?q?[CI=20SKIP]=20=E6=B7=BB=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 61 ++++++++++++++++++- .../Properties/launchSettings.json | 4 +- code/src/SettleAccount.sln | 12 ++++ 3 files changed, 73 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2fdc7a79..9d0374bd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,60 @@ -# 说明 +# 项目说明 -在提交中添加 [CI SKIP] 避免自动构建、发布和部署 +## 提交规范 + +默认进行自动构建、发布到MinIO并自动部署到测试服务器 + +1. 提交时确保编译通过,提交后检查CI服务器编译是否成功 +1. 不需要自动构建和部署的,在提交信息中添加 `[CI SKIP]` +1. 针对特定问题的解决,提交信息中添加问题编号 + +## 开发环境配置 + +### 配置文件 + +在项目 SettleAccount.HttpApi.Host 下添加开发配置文件 appsettings.development.json + +```json +{ + "ConnectionStrings": { + "Default": "Server=.;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True", + "SettleAccountService": "Server=.;Database=BQ_SA;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True;" + }, + + "AuthServer": { + "Authority": "http://localhost:44378", + "ClientId": "basic-web", + "ClientSecret": "1q2w3e*" + }, + "MinIO": { + "EndPoint": "localhost:16084" + } +} +``` + +### 文件存储 + +解压 MinIO.zip 并执行其中的 start.cmd + +### 数据库 + +本地安装 SQL Server 2016 + ,在程序包管理器控制台中切换项目并设置为启动项目后执行 EF Core 数据迁移命令 + +```sh +#AuthServer.Host +update-database -context AuthServerDbContext -connection "Server=.;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True" +#BaseService.EntityFrameworkCore +update-database -context BaseServiceMigrationDbContext -connection "Server=.;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True" +#SettleAccount.EntityFrameworkCore +update-database -context SettleAccountDbContext -connection "Server=.;Database=BQ_SA;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True;" +``` + +### 启动调试 + +入口项目:SettleAccount.HttpApi.Host + +## 部署 + +1. 部署到测试服务器时正常提交,appsettings.json 中默认为测试服务器配置,本地使用 appsettings.development.json 进行配置 +1. 部署到生产正常提交,生产环境使用 appsettings.production.json 进行配置 +1. appsettings.production.json 和 excle 导出模板目前由运维进行管理 diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json index 13d6e5ef..884c7639 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "SettleAccount.DemoApp": { + "SettleAccount.HttpApi.Host": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { @@ -16,4 +16,4 @@ "useSSL": true } } -} \ No newline at end of file +} diff --git a/code/src/SettleAccount.sln b/code/src/SettleAccount.sln index 010d03f4..12570eab 100644 --- a/code/src/SettleAccount.sln +++ b/code/src/SettleAccount.sln @@ -50,6 +50,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.HttpApi", "Modu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.HttpApi.Client", "Modules\BaseService\BaseService.HttpApi.Client\BaseService.HttpApi.Client.csproj", "{7448F9F6-DC3F-475A-BA74-B7B2968BCEF4}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthServer.Host", "AuthServer\AuthServer.Host\AuthServer.Host.csproj", "{34D97BF0-5251-41E3-AB4D-648D4ED202E0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.Host", "Modules\BaseService\BaseService.Host\BaseService.Host.csproj", "{9DD706B3-015F-42E7-9795-27313CE4FCE2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -128,6 +132,14 @@ Global {7448F9F6-DC3F-475A-BA74-B7B2968BCEF4}.Debug|Any CPU.Build.0 = Debug|Any CPU {7448F9F6-DC3F-475A-BA74-B7B2968BCEF4}.Release|Any CPU.ActiveCfg = Release|Any CPU {7448F9F6-DC3F-475A-BA74-B7B2968BCEF4}.Release|Any CPU.Build.0 = Release|Any CPU + {34D97BF0-5251-41E3-AB4D-648D4ED202E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34D97BF0-5251-41E3-AB4D-648D4ED202E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34D97BF0-5251-41E3-AB4D-648D4ED202E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34D97BF0-5251-41E3-AB4D-648D4ED202E0}.Release|Any CPU.Build.0 = Release|Any CPU + {9DD706B3-015F-42E7-9795-27313CE4FCE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DD706B3-015F-42E7-9795-27313CE4FCE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DD706B3-015F-42E7-9795-27313CE4FCE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DD706B3-015F-42E7-9795-27313CE4FCE2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE