doc(appveyor): 增加MongoDB脚本
This commit is contained in:
parent
43a264fe54
commit
d964567180
89
appveyor.yml
89
appveyor.yml
|
@ -24,6 +24,33 @@ install:
|
|||
xcopy $iniFile "C:\Program Files\MySQL\MySQL Server 5.7" /y
|
||||
build_script:
|
||||
- ps: >-
|
||||
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"
|
||||
|
||||
|
||||
$startPath = "$($env:appveyor_build_folder)\DatabaseScripts"
|
||||
|
||||
$sqlInstance = "(local)\SQL2014"
|
||||
|
@ -40,40 +67,74 @@ build_script:
|
|||
sqlcmd -S "$sqlInstance" -U sa -P Password12! -i "$sqlFile" -i "$initFile" -o "$outFile"
|
||||
|
||||
|
||||
echo ""
|
||||
|
||||
echo "*****************************************"
|
||||
|
||||
echo "Start UnitTest For SQLServer ..."
|
||||
|
||||
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SqlServer"
|
||||
|
||||
|
||||
# init mysql database
|
||||
|
||||
$env:MYSQL_PWD="Password12!"
|
||||
|
||||
$mysql = "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql"
|
||||
$cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -e "create database BootstrapAdmin;" -uroot'
|
||||
|
||||
$cmd = '$mysql -e "create database BootstrapAdmin;" -uroot'
|
||||
#iex "& $cmd"
|
||||
|
||||
iex "& $cmd"
|
||||
cmd.exe /c $cmd
|
||||
|
||||
|
||||
cd "C:\Program Files\MySQL\MySQL Server 5.7\bin\"
|
||||
|
||||
$sqlFile = join-path $startPath "MySQL\Install.sql"
|
||||
|
||||
$cmd = "mysql -hlocalhost -uroot -DBootstrapAdmin < $sqlFile"
|
||||
$cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -hlocalhost -uroot -DBootstrapAdmin <'
|
||||
|
||||
cmd.exe /c $cmd
|
||||
cmd.exe /c $cmd $sqlFile
|
||||
|
||||
|
||||
$initFile = join-path $startPath "MySQL\InitData.sql"
|
||||
|
||||
$cmd = "mysql -hlocalhost -uroot -DBootstrapAdmin < $initFile"
|
||||
$cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -hlocalhost -uroot -DBootstrapAdmin <'
|
||||
|
||||
cmd.exe /c $cmd
|
||||
cmd.exe /c $cmd $initFile
|
||||
|
||||
|
||||
echo ""
|
||||
|
||||
echo "*****************************************"
|
||||
|
||||
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 build
|
||||
|
||||
dotnet publish Bootstrap.Admin --configuration Release --no-restore
|
||||
test_script:
|
||||
- ps: dotnet test UnitTest --no-restore --filter "FullyQualifiedName!~MongoDB"
|
||||
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~MongoDB"
|
||||
artifacts:
|
||||
- path: Bootstrap.Admin\bin\release\netcoreapp2.2\publish\
|
||||
name: BootstrapAdmin
|
||||
|
|
Loading…
Reference in New Issue