BootstrapAdmin/appveyor.yml

173 lines
4.4 KiB
YAML
Raw Normal View History

2019-05-11 19:07:40 +08:00
version: 1.0.{build}
branches:
only:
- master
image: Visual Studio 2017
clone_depth: 1
clone_folder: c:\Longbow\BootstrapAdmin
init:
- ps: dotnet --version
environment:
Appveyor: true
services:
- mssql2014
- mysql
- mongodb
install:
- ps: >-
$PSVersionTable
#copy my.ini into mysql folder
$iniFile = "$($env:appveyor_build_folder)\DatabaseScripts\MySQL\my.ini"
xcopy $iniFile "C:\Program Files\MySQL\MySQL Server 5.7" /y
build_script:
- ps: >-
2019-05-14 21:20:47 +08:00
echo ""
echo "*****************************************"
echo "Start Building ..."
dotnet build
echo ""
echo "*****************************************"
echo "Start Publishing ..."
dotnet publish Bootstrap.Admin --configuration Release --no-restore
test_script:
- ps: >-
echo ""
echo "*****************************************"
echo "Start UnitTest For SQLite ..."
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SQLite"
2019-05-11 19:07:40 +08:00
$startPath = "$($env:appveyor_build_folder)\DatabaseScripts"
$sqlInstance = "(local)\SQL2014"
$outFile = "$($env:appveyor_build_folder)\DatabaseScripts\output.log"
# init sqlserver database
$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"
2019-05-14 21:20:47 +08:00
echo ""
echo "*****************************************"
echo "Start UnitTest For SQLServer ..."
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SqlServer"
2019-05-11 19:07:40 +08:00
# init mysql database
$env:MYSQL_PWD="Password12!"
2019-05-14 21:20:47 +08:00
$cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -e "create database BootstrapAdmin;" -uroot'
2019-05-11 19:07:40 +08:00
2019-05-14 21:20:47 +08:00
#iex "& $cmd"
2019-05-11 19:07:40 +08:00
2019-05-14 21:20:47 +08:00
cmd.exe /c $cmd
2019-05-11 19:07:40 +08:00
$sqlFile = join-path $startPath "MySQL\Install.sql"
2019-05-14 21:20:47 +08:00
$cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -hlocalhost -uroot -DBootstrapAdmin <'
2019-05-11 19:07:40 +08:00
2019-05-14 21:20:47 +08:00
cmd.exe /c $cmd $sqlFile
2019-05-11 19:07:40 +08:00
$initFile = join-path $startPath "MySQL\InitData.sql"
2019-05-14 21:20:47 +08:00
$cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -hlocalhost -uroot -DBootstrapAdmin <'
2019-05-11 19:07:40 +08:00
2019-05-14 21:20:47 +08:00
cmd.exe /c $cmd $initFile
2019-05-11 19:07:40 +08:00
2019-05-14 21:20:47 +08:00
echo ""
2019-05-11 19:07:40 +08:00
2019-05-14 21:20:47 +08:00
echo "*****************************************"
2019-05-11 19:07:40 +08:00
2019-05-14 21:20:47 +08:00
echo "Start UnitTest For MySql ..."
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~MySql"
# init mongodb data
$initFolder = join-path $startPath "MongoDB"
cd $initFolder
$cmd = "C:\mongodb\bin\mongo $initFolder\init.js"
iex "& $cmd"
$cmd = 'C:\mongodb\bin\mongo BootstrapAdmin --eval "printjson(db.getCollectionNames())"'
iex "& $cmd"
echo ""
echo "*****************************************"
echo "Start UnitTest For MongoDB ..."
cd $($env:appveyor_build_folder)
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~MongoDB"
2019-05-11 19:07:40 +08:00
artifacts:
- path: Bootstrap.Admin\bin\release\netcoreapp2.2\publish\
name: BootstrapAdmin
type: WebDeployPackage
deploy:
- provider: GitHub
tag: v$(appveyor_build_version)
release: BootstrapAdmin-v$(appveyor_build_version)
description: BootstrapAdmin auto generated by Appveyor
auth_token:
secure: bTF+J9xTuL63Q3fMN533GYvPEjHYPZsFRCVrpYpyFNcQpLe3CMLYT1D/x52J9nhC
artifact: BootstrapAdmin
draft: true
prerelease: true
force_update: true
2019-05-11 19:07:40 +08:00
notifications:
- provider: Email
to:
- argo@163.com
subject: 'Appveyor Build {{status}}: {{projectName}} {{buildVersion}}'
message: >-
<div style="font-family:'Segoe UI',Arial,Sans-Serif;font-size:10pt;">
{{#passed}}
<h1 style="font-size: 150%;font-weight:normal; color:#078DC7;"><a href="{{buildUrl}}" style="color:#078DC7;">Build {{projectName}} {{buildVersion}} completed</a></h1>{{/passed}}
{{#failed}}
<h1 style="font-size: 150%;font-weight:normal; color:#ff3228;"><a href="{{buildUrl}}" style="color:#ff3228;">Build {{projectName}} {{buildVersion}} failed</a></h1>{{/failed}}
<p style="color: #888;">
Commit <a href="{{commitUrl}}">{{commitId}}</a> by <a href="mailto:{{commitAuthorEmail}}">{{commitAuthor}}</a> on {{commitDate}}:
<br />
<span style="font-size: 110%;color:#222;">{{commitMessage}}</span>
</p>
<p><a href="{{notificationSettingsUrl}}" style="font-size:85%;color:#999;">Configure your notification preferences</a></p>
</div>
on_build_success: true
on_build_failure: true
on_build_status_changed: false