diff --git a/.editorconfig b/.editorconfig index 6cfb4760..4db563b4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,6 +6,10 @@ root=true # All files [*] indent_style = space +# shell files +[*.{cmd,sh,bat}] +insert_final_newline = true +trim_trailing_whitespace = true # Code files [*.{cs,csx,vb,vbx}] indent_size = 4 diff --git a/BootstrapAdmin.sln b/BootstrapAdmin.sln index 637d32d9..11a708d1 100644 --- a/BootstrapAdmin.sln +++ b/BootstrapAdmin.sln @@ -96,6 +96,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "win", "win", "{C6F2DCA0-794 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "linux", "linux", "{FDCFC3E3-14CF-40B2-9FE5-5BC239AAC110}" ProjectSection(SolutionItems) = preProject + deploy-admin.sh = deploy-admin.sh + deploy-client.sh = deploy-client.sh publish-admin.sh = publish-admin.sh publish-client.sh = publish-client.sh watch-run-admin.sh = watch-run-admin.sh diff --git a/Directory.Build.props b/Directory.Build.props index d44c5035..5a6cc485 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,4 +1,5 @@  + Longbow Argo Zhang(argo@163.com) diff --git a/appveyor.test.ps1 b/appveyor.test.ps1 index db415d0d..ab5353bc 100644 --- a/appveyor.test.ps1 +++ b/appveyor.test.ps1 @@ -1,28 +1,28 @@ function installDB() { write-host "init sqlserver database..." -ForegroundColor Cyan $startPath = "$($env:appveyor_build_folder)\db\SqlServer" - $sqlInstance = "(local)\SQL2014" + $sqlInstance = "(local)\SQL2017" $outFile = join-path $startPath "output.log" $sqlFile = join-path $startPath "Install.sql" $initFile = join-path $startPath "InitData.sql" sqlcmd -S "$sqlInstance" -U sa -P Password12! -i "$sqlFile" -i "$initFile" -o "$outFile" - write-host "init mysql database..." -ForegroundColor Cyan - $env:MYSQL_PWD="Password12!" - $mysql = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"' - $cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot' - cmd.exe /c $cmd + #write-host "init mysql database..." -ForegroundColor Cyan + #$env:MYSQL_PWD="Password12!" + #$mysql = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"' + #$cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot' + #cmd.exe /c $cmd - $startPath = "$($env:appveyor_build_folder)\db\MySQL" - $para = ' -hlocalhost -uroot -DBootstrapAdmin < ' - $sqlFile = join-path $startPath "Install.sql" - $cmd = $mysql + $para + $sqlFile - cmd.exe /c $cmd + #$startPath = "$($env:appveyor_build_folder)\db\MySQL" + #$para = ' -hlocalhost -uroot -DBootstrapAdmin < ' + #$sqlFile = join-path $startPath "Install.sql" + #$cmd = $mysql + $para + $sqlFile + #cmd.exe /c $cmd - $initFile = join-path $startPath "InitData.sql" - $cmd = $mysql + $para + $initFile - cmd.exe /c $cmd + #$initFile = join-path $startPath "InitData.sql" + #$cmd = $mysql + $para + $initFile + #cmd.exe /c $cmd write-host "init mongodb data..." -ForegroundColor Cyan $initFolder = "$($env:appveyor_build_folder)\db\MongoDB" @@ -38,7 +38,7 @@ function runUnitTest() { write-host "dotnet test test\UnitTest" -ForegroundColor Cyan - dotnet test test\UnitTest /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap*]*" /p:ExcludeByFile="..\..\src\admin\Bootstrap.Admin\Program.cs%2c..\..\src\admin\Bootstrap.Admin\Startup.cs%2c..\..\src\admin\Bootstrap.Admin\HttpHeaderOperation.cs" /p:CoverletOutput=..\..\ + dotnet test test\UnitTest --filter "(FullyQualifiedName!~MySql) & (FullyQualifiedName!~Api.SqlServer) & (FullyQualifiedName!~Api.SQLite)" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap*]*" /p:ExcludeByFile="..\..\src\admin\Bootstrap.Admin\Program.cs%2c..\..\src\admin\Bootstrap.Admin\Startup.cs%2c..\..\src\admin\Bootstrap.Admin\HttpHeaderOperation.cs" /p:CoverletOutput=..\..\ } function coverallUnitTest() { @@ -67,6 +67,9 @@ function codecovUnitTest() { cmd.exe /c "$codecovCmd -f ""coverage.opencover.xml""" } -installDB -coverallUnitTest -codecovUnitTest \ No newline at end of file +$branch = $($env:APPVEYOR_REPO_BRANCH) +if ($branch -ne "dev") { + installDB + coverallUnitTest + codecovUnitTest +} diff --git a/appveyor.yml b/appveyor.yml index 185317f1..17a26892 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,9 @@ version: 1.0.{build} branches: only: + - release - master + - dev image: Visual Studio 2019 clone_depth: 1 init: @@ -18,16 +20,11 @@ environment: secure: +22PuAn5seq4bbCVCly8zDFuyEV3m2NjW3QuM0+2gm4c8akwicNFmv2T/ZGd0Jpd cache: C:\ProgramData\chocolatey\lib\codecov\tools services: -- mssql2014 -- mysql +- mssql2017 - mongodb install: - ps: >- - #copy my.ini into mysql folder - dotnet --version - - xcopy "$($env:appveyor_build_folder)\db\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y build_script: - ps: >- .\appveyor.build.ps1 @@ -73,4 +70,4 @@ notifications: on_build_success: true on_build_failure: true - on_build_status_changed: false \ No newline at end of file + on_build_status_changed: false diff --git a/deploy-admin.sh b/deploy-admin.sh new file mode 100644 index 00000000..746df40a --- /dev/null +++ b/deploy-admin.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +cd ~/BootstrapAdmin +git pull +dotnet publish src/admin/Bootstrap.Admin -c Release + +rm -f ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp2.2/publish/appsettings*.json +systemctl stop ba.admin +\cp -fr ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp2.2/publish/* /usr/local/ba/admin/ +systemctl start ba.admin +systemctl status ba.admin -l diff --git a/deploy-client.sh b/deploy-client.sh new file mode 100644 index 00000000..8c6ea577 --- /dev/null +++ b/deploy-client.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +cd ~/BootstrapAdmin +git pull +dotnet publish src/client/Bootstrap.Client -c Release + +rm -f ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/appsettings*.json +systemctl stop ba.client +\cp -fr ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/* /usr/local/ba/client/ +systemctl start ba.client +systemctl status ba.client -l diff --git a/publish-admin.sh b/publish-admin.sh index 62cca27b..08200ca8 100644 --- a/publish-admin.sh +++ b/publish-admin.sh @@ -1,12 +1,3 @@ #! /bin/bash -cd ~/BootstrapAdmin -git pull dotnet publish src/admin/Bootstrap.Admin -c Release - -rm -f ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp3.0/publish/appsettings*.json -rm -f ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp3.0/publish/BootstrapAdmin.db -systemctl stop ba.admin -\cp -fr ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp3.0/publish/* /usr/local/ba/admin/ -systemctl start ba.admin -systemctl status ba.admin diff --git a/publish-client.sh b/publish-client.sh index ad926b27..130ba9b0 100644 --- a/publish-client.sh +++ b/publish-client.sh @@ -1,11 +1,3 @@ #! /bin/bash -cd ~/BootstrapAdmin -git pull dotnet publish src/client/Bootstrap.Client -c Release - -rm -f ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/appsettings*.json -systemctl stop ba.client -\cp -fr ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/* /usr/local/ba/client/ -systemctl start ba.client -systemctl status ba.client diff --git a/watch-run-admin.cmd b/watch-run-admin.cmd index 782c6476..571158d4 100644 --- a/watch-run-admin.cmd +++ b/watch-run-admin.cmd @@ -1,3 +1,3 @@ @echo off -dotnet watch --project ./src/admin/Bootstrap.Admin run \ No newline at end of file +dotnet watch --project ./src/admin/Bootstrap.Admin run diff --git a/watch-run-admin.sh b/watch-run-admin.sh index fa427aef..f6aa9f20 100644 --- a/watch-run-admin.sh +++ b/watch-run-admin.sh @@ -1,3 +1,3 @@ #! /bin/bash -dotnet watch --project ./src/admin/Bootstrap.Admin run \ No newline at end of file +dotnet watch --project ./src/admin/Bootstrap.Admin run diff --git a/watch-run-client.cmd b/watch-run-client.cmd index ce983821..058db3e7 100644 --- a/watch-run-client.cmd +++ b/watch-run-client.cmd @@ -1,3 +1,3 @@ @echo off -dotnet watch --project ./src/client/Bootstrap.Client run \ No newline at end of file +dotnet watch --project ./src/client/Bootstrap.Client run diff --git a/watch-run-client.sh b/watch-run-client.sh index 87a84eec..0457f727 100644 --- a/watch-run-client.sh +++ b/watch-run-client.sh @@ -1,3 +1,3 @@ #! /bin/bash -dotnet watch --project ./src/client/Bootstrap.Client run \ No newline at end of file +dotnet watch --project ./src/client/Bootstrap.Client run