forked from vitopn/ansible-sumocollector
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
139 lines (133 loc) · 5.19 KB
/
.travis.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
---
sudo: required
rvm:
- 2.6
jobs:
include:
- stage: ansible-lint
name: Ansible Lint
before_install:
- sudo apt-get -y install python3-pip python3-setuptools
- pip3 install ansible-lint
script:
- ansible-lint tasks/main.yml || true
after_script: true
- stage: deploy
name: Deploy on Ubuntu Focal
env:
- distribution: ubuntu
version: 20.04
suite: default
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deployalt
name: Centos 8
env:
- distribution: centos
version: 8
suite: default
ANSIBLE_EXTRA_FLAGS: "'-e sumologic_installer_rpm_disablegpgcheck=true'"
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deployalt
name: Centos 7
env:
- distribution: centos
version: 7
suite: default
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deployalt
name: Ubuntu 18.04
env:
- distribution: ubuntu
version: 18.04
suite: default
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deployalt
name: Ubuntu 16.04
env:
- distribution: ubuntu
version: 16.04
suite: default
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deployalt
name: Debian 10
env:
- distribution: debian
version: 10
suite: default
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deploy-runas
name: Centos 8
env:
- distribution: centos
version: 8
suite: default-runas
ANSIBLE_EXTRA_FLAGS: "'-e sumologic_installer_rpm_disablegpgcheck=true'"
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deploy-runas
name: Ubuntu 20.04
env:
- distribution: ubuntu
version: 20.04
suite: default-runas
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deploy-docker
name: Centos 8
env:
- distribution: centos
version: 8
suite: default-docker
ANSIBLE_EXTRA_FLAGS: "'-e sumologic_installer_rpm_disablegpgcheck=true'"
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
- stage: deploy-docker
name: Ubuntu 20.04
env:
- distribution: ubuntu
version: 20.04
suite: default-docker
script:
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug"
before_install:
- env
- pwd
- find -ls
## use appropriate role path and not github name
- "[ -f get-dependencies.sh ] && sh -x get-dependencies.sh"
- sudo pip install ansible ansible-lint
## need to use chef gem for some reason? BAD PATH https://github.com/chef/chef-dk/issues/15
# - chef gem install kitchen
- gem install kitchen
- gem install kitchen-ansible
- gem install kitchen-sync
- gem install kitchen-docker
- gem list
- which kitchen
- KITCHEN_YAML=.kitchen.docker.yml kitchen diagnose --all
script:
- ansible-lint tasks/main.yml || true
## avoid locale issue under xenial docker, https://github.com/pypa/pip/issues/3575
- export LC_ALL=C.UTF-8
- export LANG=C.UTF-8
- KITCHEN_YAML=.kitchen.docker.yml kitchen verify ${suite}-${distribution}-${version//./}
after_failure:
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'systemctl -l --no-pager status'
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'journalctl -xe --no-pager'
after_script:
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'sudo cat /opt/SumoCollector/config/user.properties'
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'sudo cat /opt/SumoCollector/logs/collector.log'
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'rpm -Kv /tmp/sumo_collector.rpm'
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'sudo apt-get install -y debsig-verify dpkg-sig'
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'debsig-verify /tmp/sumocollector.deb'
- KITCHEN_YAML=.kitchen.docker.yml kitchen exec ${suite}-${distribution}-${version//./} -c 'dpkg-sig --verify /tmp/sumocollector.deb'
# Clean up
- KITCHEN_YAML=.kitchen.docker.yml kitchen destroy default-${distribution}-${version//./}
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/