Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wakuflair committed Sep 7, 2020
2 parents e4ccfda + 5c02888 commit 935d866
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 6 deletions.
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
93 changes: 93 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

schedules:
- cron: "0 */6 * * *"
displayName: Daily midnight build
branches:
include:
- master
always: true

trigger:
- master

pool:
vmImage: 'ubuntu-latest'

variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '3.x'
- task: CmdLine@2
displayName: 'install dotnet-ef'
inputs:
script: 'dotnet tool install -g dotnet-ef'

- task: CmdLine@2
inputs:
script: |
echo commands
sed -i '0,/Default[^,]*/s//$(ConnectionStrings)"/g' sample/MyAbpApp/src/MyAbpApp.Web/appsettings.json
echo commands executed
- task: CmdLine@2
inputs:
script: |
echo commands
sed -i '0,/Default[^,]*/s//$(ConnectionStrings)"/g' sample/MyAbpApp/src/MyAbpApp.DbMigrator/appsettings.json
echo commands executed
- task: DotNetCoreCLI@2
displayName: 'restore'
inputs:
command: 'restore'
feedsToUse: 'select'

- task: DotNetCoreCLI@2
displayName: 'build'
inputs:
command: 'build'

- task: CmdLine@2
displayName: 'publish'
inputs:
script: |
dotnet publish
- task: CmdLine@2
displayName: 'drop database'
inputs:
script: |
dotnet ef database drop --project sample/MyAbpApp/src/MyAbpApp.EntityFrameworkCore.DbMigrations/MyAbpApp.EntityFrameworkCore.DbMigrations.csproj -s sample/MyAbpApp/src/MyAbpApp.Web/MyAbpApp.Web.csproj -f
- task: CmdLine@2
displayName: 'update database'
inputs:
script: |
dotnet ef database update --project sample/MyAbpApp/src/MyAbpApp.EntityFrameworkCore.DbMigrations/MyAbpApp.EntityFrameworkCore.DbMigrations.csproj -s sample/MyAbpApp/src/MyAbpApp.Web/MyAbpApp.Web.csproj
- task: CmdLine@2
inputs:
script: |
cd sample/MyAbpApp/src/MyAbpApp.DbMigrator
dotnet run
- task: Docker@2
displayName: 'build and push docker'
inputs:
containerRegistry: $(DockerRegistry)
repository: $(repository)
command: 'buildAndPush'
Dockerfile: 'sample/MyAbpApp/src/MyAbpApp.Web/Dockerfile'
buildContext: .
tags: 'latest'
35 changes: 35 additions & 0 deletions sample/MyAbpApp/src/MyAbpApp.Web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["sample/MyAbpApp/src/MyAbpApp.Web/MyAbpApp.Web.csproj", "sample/MyAbpApp/src/MyAbpApp.Web/"]
COPY ["src/EasyAbp.Abp.SettingUi.Web/EasyAbp.Abp.SettingUi.Web.csproj", "src/EasyAbp.Abp.SettingUi.Web/"]
COPY ["src/EasyAbp.Abp.SettingUi.HttpApi/EasyAbp.Abp.SettingUi.HttpApi.csproj", "src/EasyAbp.Abp.SettingUi.HttpApi/"]
COPY ["src/EasyAbp.Abp.SettingUi.Application.Contracts/EasyAbp.Abp.SettingUi.Application.Contracts.csproj", "src/EasyAbp.Abp.SettingUi.Application.Contracts/"]
COPY ["src/EasyAbp.Abp.SettingUi.Domain.Shared/EasyAbp.Abp.SettingUi.Domain.Shared.csproj", "src/EasyAbp.Abp.SettingUi.Domain.Shared/"]
COPY ["sample/MyAbpApp/src/MyAbpApp.Application/MyAbpApp.Application.csproj", "sample/MyAbpApp/src/MyAbpApp.Application/"]
COPY ["sample/MyAbpApp/src/MyAbpApp.Application.Contracts/MyAbpApp.Application.Contracts.csproj", "sample/MyAbpApp/src/MyAbpApp.Application.Contracts/"]
COPY ["sample/MyAbpApp/src/MyAbpApp.Domain.Shared/MyAbpApp.Domain.Shared.csproj", "sample/MyAbpApp/src/MyAbpApp.Domain.Shared/"]
COPY ["src/EasyAbp.Abp.SettingUi.Application/EasyAbp.Abp.SettingUi.Application.csproj", "src/EasyAbp.Abp.SettingUi.Application/"]
COPY ["src/EasyAbp.Abp.SettingUi.Domain/EasyAbp.Abp.SettingUi.Domain.csproj", "src/EasyAbp.Abp.SettingUi.Domain/"]
COPY ["sample/MyAbpApp/src/MyAbpApp.Domain/MyAbpApp.Domain.csproj", "sample/MyAbpApp/src/MyAbpApp.Domain/"]
COPY ["sample/MyAbpApp/src/MyAbpApp.EntityFrameworkCore.DbMigrations/MyAbpApp.EntityFrameworkCore.DbMigrations.csproj", "sample/MyAbpApp/src/MyAbpApp.EntityFrameworkCore.DbMigrations/"]
COPY ["sample/MyAbpApp/src/MyAbpApp.EntityFrameworkCore/MyAbpApp.EntityFrameworkCore.csproj", "sample/MyAbpApp/src/MyAbpApp.EntityFrameworkCore/"]
COPY ["sample/MyAbpApp/src/MyAbpApp.HttpApi/MyAbpApp.HttpApi.csproj", "sample/MyAbpApp/src/MyAbpApp.HttpApi/"]
RUN dotnet restore "sample/MyAbpApp/src/MyAbpApp.Web/MyAbpApp.Web.csproj"
COPY . .
WORKDIR "/src/sample/MyAbpApp/src/MyAbpApp.Web"
RUN dotnet build "MyAbpApp.Web.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MyAbpApp.Web.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MyAbpApp.Web.dll"]
3 changes: 3 additions & 0 deletions sample/MyAbpApp/src/MyAbpApp.Web/MyAbpApp.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>MyAbpApp-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..\..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
Expand All @@ -32,6 +34,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:44372/"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"publishAllPorts": true,
"useSSL": true
}
}
}
6 changes: 3 additions & 3 deletions src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public SettingUiAppService(IStringLocalizer<SettingUiResource> localizer,
_settingManager = settingManager;
}

public async Task<List<SettingGroup>> GroupSettingDefinitions()
public virtual async Task<List<SettingGroup>> GroupSettingDefinitions()
{
if (!await AuthorizationService.IsGrantedAsync(SettingUiPermissions.Tenant))
{
Expand All @@ -70,7 +70,7 @@ public async Task<List<SettingGroup>> GroupSettingDefinitions()
;
}

public async Task SetSettingValues(Dictionary<string, string> settingValues)
public virtual async Task SetSettingValues(Dictionary<string, string> settingValues)
{
foreach (var kv in settingValues)
{
Expand All @@ -93,7 +93,7 @@ public async Task SetSettingValues(Dictionary<string, string> settingValues)
}
}

public async Task ResetSettingValues(List<string> settingNames)
public virtual async Task ResetSettingValues(List<string> settingNames)
{
foreach (var name in settingNames)
{
Expand Down
6 changes: 3 additions & 3 deletions src/EasyAbp.Abp.SettingUi.HttpApi/SettingUiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ public SettingUiController(ISettingUiAppService service)
}

[HttpGet]
public Task<List<SettingGroup>> GroupSettingDefinitions()
public virtual Task<List<SettingGroup>> GroupSettingDefinitions()
{
return _service.GroupSettingDefinitions();
}

[HttpPut]
[Route("setSettingValues")]
public Task SetSettingValues(Dictionary<string, string> settingValues)
public virtual Task SetSettingValues(Dictionary<string, string> settingValues)
{
return _service.SetSettingValues(settingValues);
}

[HttpPut]
[Route("resetSettingValues")]
public Task ResetSettingValues(List<string> settingNames)
public virtual Task ResetSettingValues(List<string> settingNames)
{
return _service.ResetSettingValues(settingNames);
}
Expand Down

0 comments on commit 935d866

Please sign in to comment.