Merge branch 'dev-deploy' into dev

# Conflicts:
#	appveyor.yml
#	publish-admin.sh
This commit is contained in:
Argo Zhang 2019-09-29 15:40:17 +08:00
commit d05397a350
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
13 changed files with 58 additions and 46 deletions

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,5 @@
<Project>
<PropertyGroup>
<Copyright>Longbow</Copyright>
<Authors>Argo Zhang(argo@163.com)</Authors>

View File

@ -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
$branch = $($env:APPVEYOR_REPO_BRANCH)
if ($branch -ne "dev") {
installDB
coverallUnitTest
codecovUnitTest
}

View File

@ -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:
</div>
on_build_success: true
on_build_failure: true
on_build_status_changed: false
on_build_status_changed: false

11
deploy-admin.sh Normal file
View File

@ -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

11
deploy-client.sh Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

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

View File

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

View File

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

View File

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