version: 1.0.{build} branches: only: - master - dev image: Visual Studio 2017 clone_depth: 1 clone_folder: c:\Longbow\BootstrapAdmin init: - ps: dotnet --version environment: Appveyor: true COVERALLS_REPO_TOKEN: OSBtrE43PLtH6NFqk7XDZr9sZcdTYARZ4 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: >- dotnet build dotnet publish Bootstrap.Admin --configuration Release --no-restore test_script: - ps: >- if ("$($env:APPVEYOR_REPO_BRANCH)" -eq "master") { echo "" "Install coveralls.net tools" dotnet tool install coveralls.net --version 1.0.0 --tool-path "./tools" # SQLite database echo "" "Start test for SQLite" dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SQLite" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutputDirectory=../ cmd.exe /c ".\tools\csmacnz.Coveralls.exe --opencover -i coverage.xml --useRelativePaths" $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" echo "" "Start test for SqlServer" dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SqlServer" # init mysql database $env:MYSQL_PWD="Password12!" $cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -e "create database BootstrapAdmin;" -uroot' cmd.exe /c $cmd $sqlFile = join-path $startPath "MySQL\Install.sql" $cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -hlocalhost -uroot -DBootstrapAdmin <' cmd.exe /c $cmd $sqlFile $initFile = join-path $startPath "MySQL\InitData.sql" $cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -hlocalhost -uroot -DBootstrapAdmin <' cmd.exe /c $cmd $initFile echo "" "Start test 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" cd $($env:appveyor_build_folder) echo "" "Start test for MongoDB" dotnet test UnitTest --no-restore --filter "FullyQualifiedName~MongoDB" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutputDirectory=../ } 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 on: branch: master notifications: - provider: Email to: - argo@163.com subject: 'Appveyor Build {{status}}: {{projectName}} {{buildVersion}}' message: >-
Commit {{commitId}} by {{commitAuthor}} on {{commitDate}}:
{{commitMessage}}