-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
127 lines (119 loc) · 5.51 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
version: 0.1.x.{build}
skip_commits:
message: /^\(?doc|travis\)?.*/
clone_depth: 10
init:
- SET
- 'echo System architecture: %PLATFORM%'
- 'echo %APPVEYOR_REPO_NAME%'
environment:
winrm_user: winrm_test_user
winrm_password: WinRM_test_Pass@w0rd1
user_cert: c:\projects\ansible-win-aptsimulator\user.pem
user_key: c:\projects\ansible-win-aptsimulator\key.pem
user_pfx: c:\projects\ansible-win-aptsimulator\user.pfx
CYGWIN: winsymlinks:nativestrict
matrix:
- SUITE: default
ANSIBLE_VERSION: 2.5.14
ANSIBLE_EXTRA_VARS:
TARGET: cygwin64
CYG_ROOT: C:\cygwin64
CYG_SETUP: C:\cygwin64\setup-x86_64.exe
CYG_CACHE: C:\cygwin64\var\cache\setup
CYG_BASH: C:\cygwin64\bin\sh
- SUITE: default
ANSIBLE_VERSION: 2.6.11
ANSIBLE_EXTRA_VARS:
TARGET: cygwin64
CYG_ROOT: C:\cygwin64
CYG_SETUP: C:\cygwin64\setup-x86_64.exe
CYG_CACHE: C:\cygwin64\var\cache\setup
CYG_BASH: C:\cygwin64\bin\sh
- SUITE: default
ANSIBLE_VERSION: 2.7.5
ANSIBLE_EXTRA_VARS:
TARGET: cygwin64
CYG_ROOT: C:\cygwin64
CYG_SETUP: C:\cygwin64\setup-x86_64.exe
CYG_CACHE: C:\cygwin64\var\cache\setup
CYG_BASH: C:\cygwin64\bin\sh
- SUITE: full
ANSIBLE_VERSION: 2.7.5
ANSIBLE_EXTRA_VARS:
TARGET: cygwin64
CYG_ROOT: C:\cygwin64
CYG_SETUP: C:\cygwin64\setup-x86_64.exe
CYG_CACHE: C:\cygwin64\var\cache\setup
CYG_BASH: C:\cygwin64\bin\sh
- SUITE: default
ANSIBLE_VERSION: 2.7.5
ANSIBLE_EXTRA_VARS: "-e win_aptsimulator_become=true"
TARGET: cygwin64
CYG_ROOT: C:\cygwin64
CYG_SETUP: C:\cygwin64\setup-x86_64.exe
CYG_CACHE: C:\cygwin64\var\cache\setup
CYG_BASH: C:\cygwin64\bin\sh
matrix:
fast_finish: true
install:
# setup winrm
- ps: net user /Y /add $env:winrm_user $env:winrm_password
- ps: net localgroup administrators $env:winrm_user /add
- ps: $env:PATH="C:\OpenSSL-Win64\bin;$env:PATH"
- ps: Import-Module $env:APPVEYOR_BUILD_FOLDER\test\appveyor\WinrmAppveyor.psm1
- ps: New-ClientCertificate $env:winrm_user $env:APPVEYOR_BUILD_FOLDER
- ps: $env:user_cert_thumb = (Import-pfxCertificate -FilePath $env:user_pfx -CertStoreLocation Cert:\LocalMachine\root).Thumbprint
- ps: Import-pfxCertificate -FilePath $env:user_pfx -CertStoreLocation Cert:\LocalMachine\TrustedPeople
- ps: $env:winrm_cert = (New-SelfSignedCertificate -DnsName localhost -CertStoreLocation cert:\localmachine\my).Thumbprint
- ps: winrm create winrm/config/Listener?Address=*+Transport=HTTPS "@{Hostname=`"localhost`";CertificateThumbprint=`"$($env:winrm_cert)`"}"
- ps: winrm set winrm/config/client/auth '@{Basic="true"}'
- ps: winrm set winrm/config/service/auth '@{Basic="true"}'
- ps: winrm set winrm/config/service/auth '@{Certificate="true"}'
- ps: winrm set winrm/config/service/auth '@{CbtHardeningLevel="Strict"}'
- ps: winrm set winrm/config/service '@{AllowUnencrypted="true"}'
- ps: New-WinrmUserCertificateMapping $env:user_cert_thumb
- ps: $env:PATH="C:\Ruby$env:ruby_version\bin;$env:PATH"
- ps: Write-Host $env:PATH
- ps: ($pwd).path
# setup ansible
- cmd: "%CYG_SETUP% -qgnNdO -l %CYG_CACHE% -R %CYG_ROOT% -s http://cygwin.mirror.constant.com -P openssl-devel -P python2-devel -P python3-devel -P curl -P python-jinja -P python-crypto -P python-openssl -P python-setuptools -P git -P libffi-devel -P libcrypt-devel"
- cmd: "%CYG_BASH% -lc 'uname -a'"
- cmd: "%CYG_BASH% -lc 'python -m ensurepip'"
- cmd: "%CYG_BASH% -lc 'python3 -m ensurepip'"
- cmd: "%CYG_BASH% -lc 'python3 -m pip install --upgrade pip'"
- cmd: "%CYG_BASH% -lc 'python3 -m pip install pywinrm'"
- cmd: "%CYG_BASH% -lc 'python3 -m pip install ansible==%ANSIBLE_VERSION%'"
- cmd: "%CYG_BASH% -lc 'ansible --version'"
- cmd: "%CYG_BASH% -lc 'echo localhost ansible_user=$winrm_user ansible_password=$winrm_password ansible_connection=winrm'"
- cmd: "%CYG_BASH% -lc 'ls /'"
- cmd: "%CYG_BASH% -lc 'ls -l /cygdrive/c/'"
- cmd: "%CYG_BASH% -lc 'ls -l /cygdrive/c/projects/ansible-win-aptsimulator'"
- cmd: "%CYG_BASH% -lc pwd"
- cmd: "%CYG_BASH% -lc 'ansible -i /cygdrive/c/projects/ansible-win-aptsimulator/test/appveyor/inventory -m win_ping -vvv localhost'"
- cmd: "%CYG_BASH% -lc 'mkdir -p /etc/ansible/roles'"
- cmd: "%CYG_BASH% -lc 'cp /cygdrive/c/projects/ansible-win-aptsimulator/test/appveyor/ansible.cfg /etc/ansible'"
- cmd: "%CYG_BASH% -lc 'cp -R /cygdrive/c/projects/ansible-win-aptsimulator /etc/ansible/roles/juju4.win_aptsimulator'"
- cmd: "%CYG_BASH% -lc 'sh -x /cygdrive/c/projects/ansible-win-aptsimulator/get-dependencies.sh'"
build: off
test_script:
- cmd: "%CYG_BASH% -lc 'ansible-playbook /cygdrive/c/projects/ansible-win-aptsimulator/test/integration/$SUITE/default.yml --syntax-check'"
- cmd: "%CYG_BASH% -lc 'ansible-playbook -i /cygdrive/c/projects/ansible-win-aptsimulator/test/appveyor/inventory /cygdrive/c/projects/ansible-win-aptsimulator/test/integration/$SUITE/default.yml -vvvv $ANSIBLE_EXTRA_VARS'"
after_test:
- cmd: |
%CYG_BASH% -lc 'ansible-playbook -i /cygdrive/c/projects/ansible-win-aptsimulator/test/appveyor/inventory /cygdrive/c/projects/ansible-win-aptsimulator/test/integration/$SUITE/default.yml $ANSIBLE_EXTRA_VARS'
- ps: Get-WinEvent -LogName 'Microsoft-Windows-Powershell/Operational' | Select -First 20
#- ps: Get-MpThreatDetection | Sort InitialDetection -Descending
on_finish:
- ps: Get-ChildItem -Path "C:\Program Files\ansible" -Recurse
on_failure:
- ps: |
Get-WinEvent -LogName 'Microsoft-Windows-AppLocker/EXE and DLL' | Where { $_.ID -eq 8004 }
True
notifications:
- provider: Email
to:
on_build_success: false
on_build_failure: false
on_build_status_changed: false