build: 根据最新目录结构重构脚本

This commit is contained in:
Argo Zhang 2019-09-28 11:12:46 +08:00
parent 958807a0ac
commit be607e470e
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
10 changed files with 28 additions and 13 deletions

View File

@ -12,6 +12,14 @@
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup> </PropertyGroup>
<Target Condition=" '$(TargetFramework)' == 'netcoreapp2.2' " Name="PostPublish" AfterTargets="Publish">
<Message Text="Publish -> $(PublishDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src\admin\keys\Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src/admin/keys/Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src\admin\Bootstrap.Admin\BootstrapAdmin.db" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src/admin/Bootstrap.Admin/BootstrapAdmin.db" SkipUnchangedFiles="true" />
</Target>
<Target Condition=" '$(TargetFramework)' == 'netcoreapp2.2' " Name="PostBuild" AfterTargets="PostBuildEvent"> <Target Condition=" '$(TargetFramework)' == 'netcoreapp2.2' " Name="PostBuild" AfterTargets="PostBuildEvent">
<Message Text="Copy file -> $(TargetDir)" Importance="high" /> <Message Text="Copy file -> $(TargetDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)src\admin\keys\Longbow.lic" SkipUnchangedFiles="true" /> <Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)src\admin\keys\Longbow.lic" SkipUnchangedFiles="true" />

View File

@ -4,12 +4,3 @@
} }
runCmd "dotnet build src\admin\Bootstrap.Admin" runCmd "dotnet build src\admin\Bootstrap.Admin"
runCmd "dotnet publish src\admin\Bootstrap.Admin --configuration Release --no-restore" runCmd "dotnet publish src\admin\Bootstrap.Admin --configuration Release --no-restore"
$publishFolder = "$($env:appveyor_build_folder)\src\admin\Bootstrap.Admin\bin\Release\netcoreapp2.2\publish"
$licFile = "$($env:appveyor_build_folder)\src\admin\keys\Longbow.lic"
write-host "copy file $licFile" -ForegroundColor Cyan
xcopy $licFile $publishFolder /y
$dbFile = "$($env:appveyor_build_folder)\src\admin\Bootstrap.Admin\BootstrapAdmin.db"
write-host "copy file $dbFile" -ForegroundColor Cyan
xcopy $dbFile $publishFolder /y

View File

@ -1,6 +1,6 @@
function installDB() { function installDB() {
write-host "init sqlserver database..." -ForegroundColor Cyan write-host "init sqlserver database..." -ForegroundColor Cyan
$startPath = "$($env:appveyor_build_folder)\scripts\SqlServer" $startPath = "$($env:appveyor_build_folder)\db\SqlServer"
$sqlInstance = "(local)\SQL2014" $sqlInstance = "(local)\SQL2014"
$outFile = join-path $startPath "output.log" $outFile = join-path $startPath "output.log"
$sqlFile = join-path $startPath "Install.sql" $sqlFile = join-path $startPath "Install.sql"
@ -14,7 +14,7 @@
$cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot' $cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot'
cmd.exe /c $cmd cmd.exe /c $cmd
$startPath = "$($env:appveyor_build_folder)\scripts\MySQL" $startPath = "$($env:appveyor_build_folder)\db\MySQL"
$para = ' -hlocalhost -uroot -DBootstrapAdmin < ' $para = ' -hlocalhost -uroot -DBootstrapAdmin < '
$sqlFile = join-path $startPath "Install.sql" $sqlFile = join-path $startPath "Install.sql"
$cmd = $mysql + $para + $sqlFile $cmd = $mysql + $para + $sqlFile
@ -25,7 +25,7 @@
cmd.exe /c $cmd cmd.exe /c $cmd
write-host "init mongodb data..." -ForegroundColor Cyan write-host "init mongodb data..." -ForegroundColor Cyan
$initFolder = "$($env:appveyor_build_folder)\scripts\MongoDB" $initFolder = "$($env:appveyor_build_folder)\db\MongoDB"
cd $initFolder cd $initFolder
cmd.exe /c "C:\mongodb\bin\mongo init.js" cmd.exe /c "C:\mongodb\bin\mongo init.js"

View File

@ -27,7 +27,7 @@ install:
dotnet --version dotnet --version
xcopy "$($env:appveyor_build_folder)\scripts\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y xcopy "$($env:appveyor_build_folder)\db\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y
build_script: build_script:
- ps: >- - ps: >-
.\appveyor.build.ps1 .\appveyor.build.ps1

3
publish-admin.cmd Normal file
View File

@ -0,0 +1,3 @@
@echo off
dotnet publish src\admin\Bootstrap.Admin -c Release

3
publish-client.cmd Normal file
View File

@ -0,0 +1,3 @@
@echo off
dotnet publish src\client\Bootstrap.Client -c Release

3
watch-run-admin.cmd Normal file
View File

@ -0,0 +1,3 @@
@echo off
dotnet watch --project ./src/admin/Bootstrap.Admin run

View File

@ -1 +1,3 @@
#! /bin/bash
dotnet watch --project ./src/admin/Bootstrap.Admin run dotnet watch --project ./src/admin/Bootstrap.Admin run

3
watch-run-client.cmd Normal file
View File

@ -0,0 +1,3 @@
@echo off
dotnet watch --project ./src/client/Bootstrap.Client run

View File

@ -1 +1,3 @@
#! /bin/bash
dotnet watch --project ./src/client/Bootstrap.Client run dotnet watch --project ./src/client/Bootstrap.Client run