forked from puppetlabs/bolt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
137 lines (120 loc) · 5.55 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
# See https://www.appveyor.com/docs/lang/ruby/
version: 0.1.0.{build}-{branch}
cache:
- .bundle
matrix:
fast_finish: true
configuration:
- Agentfull
- Agentless
environment:
BOLT_WINRM_USER: roddypiper
BOLT_WINRM_HOST: localhost
BOLT_WINRM_PORT: 5985
BOLT_WINRM_SSL_PORT: 5986
RUBY_VERSION: 25
install:
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
- bundle config --local path .bundle
- bundle install --jobs 3 --retry 3
build: off
for:
-
matrix:
only:
- configuration: Agentless
environment:
BOLT_WINDOWS: true
before_test:
- ps: |
ruby -v
gem -v
bundle -v
type Gemfile.lock
$CACertFile = Join-Path -Path $ENV:AppData -ChildPath 'RubyCACert.pem'
If (-Not (Test-Path -Path $CACertFile)) {
"Downloading CA Cert bundle.."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri 'https://curl.haxx.se/ca/cacert.pem' -UseBasicParsing -OutFile $CACertFile | Out-Null
}
"Setting CA Certificate store set to $CACertFile.."
$ENV:SSL_CERT_FILE = $CACertFile
[System.Environment]::SetEnvironmentVariable('SSL_CERT_FILE',$CACertFile, [System.EnvironmentVariableTarget]::Machine)
bundle exec r10k puppetfile install
Add-Type -AssemblyName System.Web
$ENV:BOLT_WINRM_PASSWORD = "&aA4" + [System.Web.Security.Membership]::GeneratePassword(10, 3)
($user = New-LocalUser -Name $ENV:BOLT_WINRM_USER -Password (ConvertTo-SecureString -String $ENV:BOLT_WINRM_PASSWORD -Force -AsPlainText)) | Format-List
Add-LocalGroupMember -Group 'Remote Management Users' -Member $user
Add-LocalGroupMember -Group Administrators -Member $user
# configure WinRM to use resources/cert.pfx for SSL
($cert = Import-PfxCertificate -FilePath resources/cert.pfx -CertStoreLocation cert:\\LocalMachine\\My -Password (ConvertTo-SecureString -String bolt -Force -AsPlainText)) | Format-List
New-WSManInstance -ResourceURI winrm/config/Listener -SelectorSet @{Address='*';Transport='HTTPS'} -ValueSet @{Hostname='localhost';CertificateThumbprint=$cert.Thumbprint} | Format-List
test_script:
- bundle exec rake appveyor
- ps: |
$test_fail = 0
$mods = ("boltlib", "ctrl", "file", "system")
Get-ChildItem bolt-modules -Directory -Include $mods | foreach {
cd $_.FullName;
$test_output = bundle exec rake spec
$r = $LASTEXITCODE
Write-Output $test_output
if($r) {
$test_fail = $r
}
}
if($test_fail) { throw "core module tests failed" }
cd ../..
- ps: |
$test_fail = 0
$mods = ("canary", "aggregate", "puppetdb_fact")
Get-ChildItem modules -Directory -Include $mods | foreach {
cd $_.FullName;
$test_output = bundle exec rake spec
$r = $LASTEXITCODE
Write-Output $test_output
if($r) {
$test_fail = $r
}
}
if($test_fail) { throw "module tests failed" }
cd ../..
-
matrix:
exclude:
- configuration: Agentfull
RUBY_VERSION: 23
- configuration: Agentfull
RUBY_VERSION: 24
environment:
APPVEYOR_AGENTS: true
before_test:
- ps: |
ruby -v
gem -v
bundle -v
type Gemfile.lock
$CACertFile = Join-Path -Path $ENV:AppData -ChildPath 'RubyCACert.pem'
If (-Not (Test-Path -Path $CACertFile)) {
"Downloading CA Cert bundle.."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri 'https://curl.haxx.se/ca/cacert.pem' -UseBasicParsing -OutFile $CACertFile | Out-Null
}
"Setting CA Certificate store set to $CACertFile.."
$ENV:SSL_CERT_FILE = $CACertFile
[System.Environment]::SetEnvironmentVariable('SSL_CERT_FILE',$CACertFile, [System.EnvironmentVariableTarget]::Machine)
bundle exec r10k puppetfile install
Add-Type -AssemblyName System.Web
$ENV:BOLT_WINRM_PASSWORD = "&aA4" + [System.Web.Security.Membership]::GeneratePassword(10, 3)
($user = New-LocalUser -Name $ENV:BOLT_WINRM_USER -Password (ConvertTo-SecureString -String $ENV:BOLT_WINRM_PASSWORD -Force -AsPlainText)) | Format-List
Add-LocalGroupMember -Group 'Remote Management Users' -Member $user
Add-LocalGroupMember -Group Administrators -Member $user
# Make sure Puppet Ruby take precedence over system ruby (pup 5/6)
$puppet_five_ruby = "C:\Program Files\Puppet Labs\Puppet\sys\ruby\bin"
$puppet_six_ruby = "C:\Program Files\Puppet Labs\Puppet\puppet\bin"
[System.Environment]::SetEnvironmentVariable("Path","$puppet_five_ruby;$puppet_six_ruby;" + $ENV:Path, [System.EnvironmentVariableTarget]::Machine)
# configure WinRM to use resources/cert.pfx for SSL
($cert = Import-PfxCertificate -FilePath resources/cert.pfx -CertStoreLocation cert:\\LocalMachine\\My -Password (ConvertTo-SecureString -String bolt -Force -AsPlainText)) | Format-List
New-WSManInstance -ResourceURI winrm/config/Listener -SelectorSet @{Address='*';Transport='HTTPS'} -ValueSet @{Hostname='localhost';CertificateThumbprint=$cert.Thumbprint} | Format-List
test_script:
- bundle exec rake integration:appveyor_agents