-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor-livedeploy.yml
59 lines (59 loc) · 2.2 KB
/
appveyor-livedeploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
version: 1.1.{build}
image: Visual Studio 2017 Preview
cache:
- packages -> **\packages.config
branches:
only:
- never-build-branch-automatically-dont-use-this-name
environment:
usernamePassword:
secure: 9355KTIDMhE43lIhZPfiQA==
before_build:
- cmd: dotnet --version
- cmd: dotnet restore --verbosity m
configuration:
- Release
build:
project: Mp3MusicZone.sln
verbosity: minimal
build_script:
- msbuild /verbosity:quiet "Mp3MusicZone.sln"
- cmd: dotnet publish ./Mp3MusicZone.Web/Mp3MusicZone.Web.csproj
artifacts:
- path: '.\Mp3MusicZone.Web\bin\Release\netcoreapp2.2\publish'
name: WebSite
type: WebDeployPackage
before_test:
- ps: |
echo '{
"ConnectionStrings": {
"MusicZoneConnectionString": "Server=(local)\\SQL2017;Database=Mp3ZoneDB-SIT;Trusted_Connection=True;MultipleActiveResultSets=true;User Id=sa;Password=Password12!"
}
}' > '.\Mp3MusicZone.IntegrationTests\appsettings.json'
test_script:
- cmd: dotnet test .\Mp3MusicZone.UnitTests\Mp3MusicZone.UnitTests.csproj -c Release --logger:"trx;LogFileName=UnitTestsResults.trx"
- cmd: dotnet test .\Mp3MusicZone.IntegrationTests\Mp3MusicZone.IntegrationTests.csproj -c Release --logger:"trx;LogFileName=IntegrationTestsResults.trx"
after_test:
- ps: |
$wc = New-Object 'System.Net.WebClient'
$resultsUnitTests = Resolve-Path .\Mp3MusicZone.UnitTests\TestResults\*.trx
$resultsIntegrationTests = Resolve-Path .\Mp3MusicZone.IntegrationTests\TestResults\*.trx
Write-Host "$($resultsUnitTests[0]) $($resultsIntegrationTests[0])"
$wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", ($resultsUnitTests[0]))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", ($resultsIntegrationTests[0]))
deploy:
provider: WebDeploy
server: https://mp3musiczone.scm.azurewebsites.net:443/msdeploy.axd?site=mp3musiczone
website: mp3musiczone
username: $mp3musiczone
password: gbny4e59rQPGSql3fRFDgznoKfaFr2xSch1cdoRx64zvbs6Ea3e7edt9bZH6
name: "Mp3MusicZone-Live"
artifact: WebSite
aspnet_core: true
aspnet_core_force_restart: true
remove_files: true
app_offline: true
on:
branch: master
services:
- mssql2017