Skip to content

Commit

Permalink
deploy: add once deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
colinin committed Apr 26, 2024
1 parent eafbf79 commit 6cafff2
Show file tree
Hide file tree
Showing 98 changed files with 1,628 additions and 1,281 deletions.
2 changes: 1 addition & 1 deletion apps/vue/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ VITE_LEGACY=false
VITE_GLOB_MULTITENANCY_KEY='__tenant'

# STS Connect
VITE_GLOB_AUTHORITY='http://127.0.0.1:44385'
VITE_GLOB_AUTHORITY='http://auth-server:44385'
VITE_GLOB_CLIENT_ID='vue-admin-client'
VITE_GLOB_CLIENT_SECRET='1q2w3e*'

2 changes: 1 addition & 1 deletion apps/vue/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ COPY ./dist /usr/share/nginx/html
# 将docker容器中默认的配置替换为本地配置
COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf

# 端口映射
EXPOSE 80
11 changes: 6 additions & 5 deletions apps/vue/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
version: '3.4'

services:
vue-vben-client:
ui:
build:
context: .
restart: always
environment:
- VITE_GLOB_AUTHORITY=http://127.0.0.1:44385
ports:
- "40080:80"
networks:
- framework
- abp-next-admin

networks:
framework:
external:
name: ly_app_net
abp-next-admin:
driver: bridge
10 changes: 5 additions & 5 deletions apps/vue/docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ server {
}

location /connect/ {
proxy_pass http://127.0.0.1:44385/;
proxy_set_header Host 127.0.0.1:44385;
proxy_pass http://auth-server:44385/;
proxy_set_header Host auth-server:44385;
}

location ~ /api/files/static/ {
# 当path参数存在子路径时 不能让nginx解码 / 符号
proxy_pass http://127.0.0.1:30000;
proxy_pass http://apigateway:30000;
}

location /api/ {
proxy_pass http://127.0.0.1:30000/;
proxy_pass http://apigateway:30000/;
proxy_set_header Host $host;
}

Expand All @@ -45,7 +45,7 @@ server {
}

location /signalr-hubs/ {
proxy_pass http://127.0.0.1:30000/;
proxy_pass http://apigateway:30000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Expand Down
4 changes: 1 addition & 3 deletions aspnet-core/create-database.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ call .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.EntityFrameworkCore me
call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.EntityFrameworkCore task-management --ef-u
call .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.EntityFrameworkCore webhooks-management --ef-u

taskkill /IM dotnet.exe /F

pause
taskkill /IM dotnet.exe /F
3 changes: 1 addition & 2 deletions aspnet-core/migrate-database.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.DbMigrator task-managem
call .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.DbMigrator webhooks-management --run
call .\migrate-db-cmd.bat LY.MicroService.BackendAdmin.DbMigrator admin --run


pause
taskkill /IM dotnet.exe /F
2 changes: 1 addition & 1 deletion aspnet-core/migrate-db-cmd.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if '%3' equ '' goto run
exit

:run
dotnet run
start cmd.exe /c dotnet run
goto end

:restore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
//options.AddDataMigrationEnvironment();
options.AddDataMigrationEnvironment();
});
await application.InitializeAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ namespace LY.MicroService.AuthServer.DbMigrator;
)]
public partial class AuthServerDbMigratorModule : AbpModule
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
</PackageReference>
<PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySql" />
<PackageReference Include="Volo.Abp.OpenIddict.EntityFrameworkCore" />
</ItemGroup>

<ItemGroup>
Expand All @@ -31,7 +30,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.EntityFrameworkCore\LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\LY.MicroService.AuthServer.EntityFrameworkCore\LY.MicroService.AuthServer.EntityFrameworkCore.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async static Task Main(string[] args)
.MinimumLevel.Override("LY.MicroService.AuthServer.DbMigrator", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.WriteTo.Console()
.WriteTo.Console(outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}")
.WriteTo.File("Logs/migrations.txt")
.CreateLogger();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=AuthServer-v70;User Id=root;Password=123456;SslMode=None",
"AbpIdentity": "Server=127.0.0.1;Database=AuthServer-v70;User Id=root;Password=123456;SslMode=None",
"OpenIddict": "Server=127.0.0.1;Database=AuthServer-v70;User Id=root;Password=123456;SslMode=None",
"AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None"
"AbpAuditLogging": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AbpOpenIddict": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None",
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None",
"AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None",
"AbpSaas": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AbpTenantManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AbpTextTemplating": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456;SslMode=None",
"Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None",
"MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None"
},
"StringEncryption": {
"DefaultPassPhrase": "s46c5q55nxpeS8Ra",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Identity;
using LINGYUN.Abp.Identity;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
Expand All @@ -12,6 +13,7 @@
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
using IdentityPermissions = Volo.Abp.Identity.IdentityPermissions;

namespace LY.MicroService.AuthServer.EntityFrameworkCore;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.Identity.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Authorization;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;

namespace LY.MicroService.AuthServer.EntityFrameworkCore;

[DependsOn(
typeof(AbpAuthorizationModule),
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpSaasEntityFrameworkCoreModule),
typeof(AbpOpenIddictEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpTextTemplatingEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule)
)]
public class AuthServerMigrationsEntityFrameworkCoreModule : AbpModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
<PackageReference Include="Volo.Abp.Authorization" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySql" />
<PackageReference Include="Volo.Abp.OpenIddict.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Application.Contracts\LINGYUN.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.EntityFrameworkCore\LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
// options.AddDataMigrationEnvironment();
options.AddDataMigrationEnvironment();
});
await application.InitializeAsync();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
using LINGYUN.Abp.TextTemplating;
using LINGYUN.Abp.Auditing;
using LINGYUN.Abp.CachingManagement;
using LINGYUN.Abp.Identity;
using LINGYUN.Abp.IdentityServer;
using LINGYUN.Abp.LocalizationManagement;
using LINGYUN.Abp.MessageService;
using LINGYUN.Abp.Notifications;
using LINGYUN.Abp.OpenIddict;
using LINGYUN.Abp.OssManagement;
using LINGYUN.Abp.SettingManagement;
using LINGYUN.Abp.TaskManagement;
using LINGYUN.Abp.TextTemplating;
using LINGYUN.Abp.WebhooksManagement;
using LINGYUN.Platform;
using LY.MicroService.BackendAdmin.EntityFrameworkCore;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Autofac;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Features;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;

namespace LY.MicroService.BackendAdmin.DbMigrator;

[DependsOn(
typeof(BackendAdminMigrationsEntityFrameworkCoreModule),
typeof(AbpFeatureManagementApplicationContractsModule),
typeof(AbpSettingManagementApplicationContractsModule),
typeof(AbpPermissionManagementApplicationContractsModule),
typeof(AbpLocalizationManagementApplicationContractsModule),
typeof(AbpCachingManagementApplicationContractsModule),
typeof(AbpAuditingApplicationContractsModule),
typeof(AbpTextTemplatingApplicationContractsModule),
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpIdentityServerApplicationContractsModule),
typeof(AbpOpenIddictApplicationContractsModule),
typeof(PlatformApplicationContractModule),
typeof(AbpOssManagementApplicationContractsModule),
typeof(AbpNotificationsApplicationContractsModule),
typeof(AbpMessageServiceApplicationContractsModule),
typeof(TaskManagementApplicationContractsModule),
typeof(WebhooksManagementApplicationContractsModule),
typeof(AbpAutofacModule)
)]
public partial class BackendAdminDbMigratorModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<SettingManagementOptions>(options =>
{
options.IsDynamicSettingStoreEnabled = true;
options.SaveStaticSettingsToDatabase = true;
});
Configure<FeatureManagementOptions>(options =>
{
options.IsDynamicFeatureStoreEnabled = true;
options.SaveStaticFeaturesToDatabase = true;
});
Configure<PermissionManagementOptions>(options =>
{
options.IsDynamicPermissionStoreEnabled = true;
options.SaveStaticPermissionsToDatabase = true;
});
Configure<AbpTextTemplatingCachingOptions>(options =>
{
options.IsDynamicTemplateDefinitionStoreEnabled = true;
options.SaveStaticTemplateDefinitionToDatabase = true;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<PackageReference Include="Serilog.Extensions.Logging" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Serilog.Sinks.Console" />
<PackageReference Include="Microsoft.Extensions.Hosting"/>
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" />
</ItemGroup>

<ItemGroup>
Expand All @@ -29,7 +30,22 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LY.MicroService.BackendAdmin.EntityFrameworkCore\LY.MicroService.BackendAdmin.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\webhooks\LINGYUN.Abp.WebhooksManagement.Application.Contracts\LINGYUN.Abp.WebhooksManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.TaskManagement.Application.Contracts\LINGYUN.Abp.TaskManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\realtime-notifications\LINGYUN.Abp.Notifications.Application.Contracts\LINGYUN.Abp.Notifications.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\realtime-message\LINGYUN.Abp.MessageService.Application.Contracts\LINGYUN.Abp.MessageService.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Platform.Application.Contracts\LINGYUN.Platform.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.Application.Contracts\LINGYUN.Abp.OssManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.Application.Contracts\LINGYUN.Abp.LocalizationManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Application.Contracts\LINGYUN.Abp.IdentityServer.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Application.Contracts\LINGYUN.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\openiddict\LINGYUN.Abp.OpenIddict.Application.Contracts\LINGYUN.Abp.OpenIddict.Application.Contracts.csproj" />
<ProjectReference Include="..\..\framework\settings\LINGYUN.Abp.SettingManagement.Application.Contracts\LINGYUN.Abp.SettingManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\auditing\LINGYUN.Abp.Auditing.Application.Contracts\LINGYUN.Abp.Auditing.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\caching-management\LINGYUN.Abp.CachingManagement.Application.Contracts\LINGYUN.Abp.CachingManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\feature-management\LINGYUN.Abp.FeatureManagement.Application.Contracts\LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.Application.Contracts\LINGYUN.Abp.TextTemplating.Application.Contracts.csproj" />
<ProjectReference Include="..\LY.MicroService.BackendAdmin.EntityFrameworkCore\LY.MicroService.BackendAdmin.EntityFrameworkCore.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async static Task Main(string[] args)
.MinimumLevel.Override("LY.MicroService.BackendAdmin.DbMigrator", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.WriteTo.Console()
.WriteTo.Console(outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}")
.WriteTo.File("Logs/migrations.txt")
.CreateLogger();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
{
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpTextTemplating": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None"
"AbpAuditLogging": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpOpenIddict": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456",
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456",
"AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpTenantManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpTextTemplating": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456",
"Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456",
"MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456"
},
"StringEncryption": {
"DefaultPassPhrase": "s46c5q55nxpeS8Ra",
Expand Down
Loading

0 comments on commit 6cafff2

Please sign in to comment.