-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathappveyor.yml
101 lines (95 loc) · 4.75 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
---
version: 0.1.x.{build}
skip_commits:
message: /^\(?doc\)?.*/
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-ipv6\user.pem
user_key: c:\projects\ansible-ipv6\key.pem
user_pfx: c:\projects\ansible-ipv6\user.pfx
CYGWIN: winsymlinks:nativestrict
matrix:
- SUITE: default
ANSIBLE_VERSION: 4.3.0
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: 3.4.0
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
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 libssl-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 -P python36-cryptography"
- cmd: "%CYG_BASH% -lc 'openssl version'"
- 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 cryptography==3.3.2'"
- 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-ipv6'"
- cmd: "%CYG_BASH% -lc pwd"
- cmd: "%CYG_BASH% -lc 'ansible -i /cygdrive/c/projects/ansible-ipv6/test/appveyor/inventory -m win_ping -vvv localhost'"
- cmd: "%CYG_BASH% -lc 'mkdir -p /etc/ansible/roles'"
- cmd: "%CYG_BASH% -lc 'cp -R /cygdrive/c/projects/ansible-ipv6 /etc/ansible/roles/juju4.ipv6'"
build: off
test_script:
- cmd: "%CYG_BASH% -lc 'ansible-playbook /cygdrive/c/projects/ansible-ipv6/test/integration/%SUITE%/default.yml --syntax-check'"
- cmd: "%CYG_BASH% -lc 'ansible-playbook -i /cygdrive/c/projects/ansible-ipv6/test/appveyor/inventory /cygdrive/c/projects/ansible-ipv6/test/integration/%SUITE%/default.yml -vvv $ANSIBLE_EXTRA_VARS'"
on_finish:
- cmd: |
%CYG_BASH% -lc 'ansible-playbook -i /cygdrive/c/projects/ansible-ipv6/test/appveyor/inventory /cygdrive/c/projects/ansible-ipv6/test/integration/%SUITE%/default.yml $ANSIBLE_EXTRA_VARS' || exit 0
- cmd: "%CYG_BASH% -lc 'ansible -i /cygdrive/c/projects/ansible-ipv6/test/appveyor/inventory -m setup -vvv localhost'"
- cmd: netsh interface ipv6 show interfaces
- cmd: netsh interface ipv6 show addresses
- cmd: netsh interface ipv6 show destinationcache
- cmd: netsh interface ipv6 show dnsservers
- cmd: netsh interface ipv6 show neighbors
- cmd: netsh interface ipv6 show route
notifications:
- provider: Email
to:
on_build_success: false
on_build_failure: false
on_build_status_changed: false