forked from PowerShellOrg/tug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
160 lines (92 loc) · 4.85 KB
/
appveyor.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
version: 0.6.0.{build}
branches:
only:
- ci
- ci2
- migrate-sdk104
skip_tags: true
init:
- ps: >-
## Need to delete .NET Core 1.1 SDK components to roll back to 1.0
## because of some incompatible behavior (such as during dotnet test)
del -Recurse -Force "C:\Program Files\dotnet\sdk\1.0.0-preview2-1-003177"
del -Recurse -Force "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.0"
del -Recurse -Force 'C:\Program Files\dotnet\swidtag\Microsoft .NET Core 1.1.0 - SDK 1.0.0 Preview 2.1-003177 (x64).swidtag'
## Check if we should Enable RDP access
if ([int]$((Resolve-DnsName blockrdp.tug-ci.tug.bkkr.us -Type TXT).Text)) {
## As per: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
}
environment:
NUGET_TUGPRE_URL:
secure: lPKGVCppnueaexpFZEAw6bNX0wMmjTM1woyhGuOlSpWv2+W/jyeVrWi6WUWa8DZI
NUGET_TUGPRE_API_KEY:
secure: YgniOlPvY8QhpvATtvXiPP9zM65vI/zvanIzIFZ2YJvK+xxfzgwEKpj8CcZjHf1k
services: iis
hosts:
DSC-SERVER1.tugnet: 127.0.0.1
install:
- ps: >-
## We want to setup a local PowerShell DSC Pull Server to support
## some of the unit tests that validate protocol compatibility
Install-WindowsFeature PowerShell,PowerShell-ISE,DSC-Service
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module xWebAdministration -Force
Install-Module xPSDesiredStateConfiguration -Force
Start-Service W3SVC ## This is normally not running on AV
## Run it once to create new cert
.\tools\ci\DSC\DscPullServer.dsc.ps1 -RegistrationKey c3ea5066-ce5a-4d12-a42a-850be287b2d8
## Run it a second time to install cert
.\tools\ci\DSC\DscPullServer.dsc.ps1 -RegistrationKey c3ea5066-ce5a-4d12-a42a-850be287b2d8
## Publish a Test MOF used by unit tests
.\tools\ci\DSC\TestConfig1.dsc.ps1
## Copy over exactly as found
.\tools\ci\DSC\StaticTestConfig-copy.ps1
.\tools\ci\DSC\xPSDesiredStateConfiguration-copy.ps1
build_script:
- ps: >-
## With a little help from:
## https://github.com/StevenLiekens/dotnet-core-appveyor/blob/master/appveyor.yml
#$Env:LABEL = "CI" + $Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0")
appveyor-retry dotnet restore -v Minimal
dotnet build "src\Tug.Base" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Client" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Server.Base" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Server" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Server.Providers.Ps5DscHandler" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "test\Tug.Ext-tests" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "test\Tug.Ext-tests-aux" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "test\client\Tug.Client-tests"
dotnet build "test\server\Tug.Server-itests"
test_script:
- ps: >-
## We're only testing .NET Framework for now because there are some
## inconsistencies on AV for .NET Core that are failing dynamic loading
dotnet test "test\Tug.Ext-tests\Tug.Ext-tests.csproj" -f net452
dotnet test "test\client\Tug.Client-tests\Tug.Client-tests.csproj"
## Only testing .NET Framework for now -- this test assembly is based on
## 4.6.2 because it's the minimum needed to support ASP.NET Core TestHost
dotnet test "test\server\Tug.Server-itests\Tug.Server-itests.csproj" -f net462
deploy: off
on_success:
- ps: >-
## If builds and tests are successful, package up
## some pre-configured bundles and publish them
$bundlePath = '.\src\bundles\Tug.Server-ps5'
$modulePath = $bundlePath + '\bin\posh-modules\Tug.Server-ps5'
dotnet build $bundlePath
& "$bundlePath\build-posh-module.cmd"
## Push bundle to a pre-release Nuget Repo
$nugetUrl = $env:NUGET_TUGPRE_URL
$nugetKey = $env:NUGET_TUGPRE_API_KEY
Update-ModuleManifest -Path $modulePath\Tug.Server-ps5.psd1 -ModuleVersion $env:APPVEYOR_BUILD_VERSION
Register-PSRepository -Name tug-pre -PackageManagementProvider nuget -SourceLocation $nugetUrl -PublishLocation $nugetUrl
Publish-Module -Path $modulePath -Repository tug-pre -NuGetApiKey $nugetKey
on_finish:
- ps: >-
## Check if we should Enable RDP access
if ([int]$((Resolve-DnsName blockrdp.tug-ci.tug.bkkr.us -Type TXT).Text)) {
## As per: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
$blockRdp = $true
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
}