forked from simp/pupmod-simp-rsyslog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
294 lines (249 loc) · 8.2 KB
/
.gitlab-ci.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# ------------------------------------------------------------------------------
# NOTICE: **This file is maintained with puppetsync**
# ------------------------------------------------------------------------------
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
#
# https://puppet.com/docs/pe/2019.8/component_versions_in_recent_pe_releases.html
# https://puppet.com/misc/puppet-enterprise-lifecycle
# https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# SIMP 6.4 5.5 2.4.10 TBD
# PE 2018.1 5.5 2.4.10 2021-01 (LTS overlap)
# PE 2019.8 6.16 2.5.7 2021-11 (LTS)
---
stages:
- 'sanity'
- 'validation'
- 'acceptance'
- 'compliance'
- 'deployment'
variables:
PUPPET_VERSION: 'UNDEFINED' # <- Matrixed jobs MUST override this (or fail)
BUNDLER_VERSION: '1.17.1'
# Force dependencies into a path the gitlab-runner user can write to.
# (This avoids some failures on Runners with misconfigured ruby environments.)
GEM_HOME: .vendor/gem_install
BUNDLE_CACHE_PATH: .vendor/bundle
BUNDLE_PATH: .vendor/bundle
BUNDLE_BIN: .vendor/gem_install/bin
BUNDLE_NO_PRUNE: 'true'
# bundler dependencies and caching
#
# - Cache bundler gems between pipelines foreach Ruby version
# - Try to use cached and local resources before downloading dependencies
# --------------------------------------
.setup_bundler_env: &setup_bundler_env
cache:
key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
paths:
- '.vendor'
before_script:
- 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=e.map{|x| x.size}.max+1; e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
- 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-1.17.1}")'
- 'declare GEM_INSTALL_CMD=(gem install --no-document)'
- 'declare BUNDLER_INSTALL_CMD=(bundle install --no-binstubs --jobs $(nproc) "${FLAGS[@]}")'
- 'mkdir -p ${GEM_HOME} ${BUNDLER_BIN}'
- 'gem list -ie "${GEM_BUNDLER_VER[@]}" --silent bundler || "${GEM_INSTALL_CMD[@]}" --local "${GEM_BUNDLER_VER[@]}" bundler || "${GEM_INSTALL_CMD[@]}" "${GEM_BUNDLER_VER[@]}" bundler'
- 'rm -rf pkg/ || :'
- 'bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL_CMD[@]}" --local || "${BUNDLER_INSTALL_CMD[@]}" || bundle pristine || "${BUNDLER_INSTALL_CMD[@]}") || { echo "PIPELINE: Bundler could not install everything (see log output above)" && exit 99 ; }'
# To avoid running a prohibitive number of tests every commit,
# don't set this env var in your gitlab instance
.only_with_SIMP_FULL_MATRIX: &only_with_SIMP_FULL_MATRIX
only:
variables:
- $SIMP_FULL_MATRIX == "yes"
# Puppet Versions
#-----------------------------------------------------------------------
.pup_5: &pup_5
image: 'ruby:2.4'
variables:
PUPPET_VERSION: '~> 5.0'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'
.pup_5_5_17: &pup_5_5_17
image: 'ruby:2.4'
variables:
PUPPET_VERSION: '5.5.17'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'
.pup_6: &pup_6
image: 'ruby:2.5'
variables:
PUPPET_VERSION: '~> 6.0'
BEAKER_PUPPET_COLLECTION: 'puppet6'
MATRIX_RUBY_VERSION: '2.5'
.pup_6_16_0: &pup_6_16_0
image: 'ruby:2.5'
variables:
PUPPET_VERSION: '6.16.0'
BEAKER_PUPPET_COLLECTION: 'puppet6'
MATRIX_RUBY_VERSION: '2.5'
# Testing Environments
#-----------------------------------------------------------------------
.lint_tests: &lint_tests
stage: 'validation'
tags: ['docker']
<<: *setup_bundler_env
script:
- 'bundle exec rake syntax'
- 'bundle exec rake lint'
- 'bundle exec rake metadata_lint'
.unit_tests: &unit_tests
stage: 'validation'
tags: ['docker']
<<: *setup_bundler_env
script:
- 'bundle exec rake spec'
.acceptance_base: &acceptance_base
stage: 'acceptance'
tags: ['beaker']
<<: *setup_bundler_env
.compliance_base: &compliance_base
stage: 'compliance'
tags: ['beaker']
<<: *setup_bundler_env
# Pipeline / testing matrix
#=======================================================================
sanity_checks:
<<: *pup_5
<<: *setup_bundler_env
stage: 'sanity'
tags: ['docker']
script:
- 'if `hash apt-get`; then apt-get update; fi'
- 'if `hash apt-get`; then apt-get install -y rpm; fi'
- 'bundle exec rake check:dot_underscore'
- 'bundle exec rake check:test_file'
- 'bundle exec rake pkg:check_version'
- 'bundle exec rake pkg:compare_latest_tag'
- 'bundle exec rake pkg:create_tag_changelog'
- 'bundle exec puppet module build'
# Linting
#-----------------------------------------------------------------------
pup5-lint:
<<: *pup_5
<<: *lint_tests
pup6-lint:
<<: *pup_6
<<: *lint_tests
# Unit Tests
#-----------------------------------------------------------------------
pup5-unit:
<<: *pup_5
<<: *unit_tests
pup5.5.17-unit:
<<: *pup_5_5_17
<<: *unit_tests
pup6-unit:
<<: *pup_6
<<: *unit_tests
pup6.16.0-unit:
<<: *pup_6_16_0
<<: *unit_tests
# Repo-specific content
# ==============================================================================
pup5.5.17:
<<: *pup_5_5_17
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,default]'
pup5.5.17-centos7:
<<: *pup_5_5_17
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'bundle exec rake beaker:suites[default,centos-7]'
# Until we can figure out how to make this test robust, it is not worth
# wasting GitLab runner time to run this permutation.
# Manually, we can see that failover is working, but all the messages
# don't make it to the failover server in a timely fashion, even if
# we force the rsyslog queues to be small.
#pup5.5.17-failover:
# <<: *pup_5_5_17
# <<: *acceptance_base
# <<: *only_with_SIMP_FULL_MATRIX
# script:
# - 'bundle exec rake beaker:suites[failover,default]'
pup5.5.17-doubleforward:
<<: *pup_5_5_17
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[doubleforward,default]'
pup5.5.17-centos7-doubleforward:
<<: *pup_5_5_17
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'bundle exec rake beaker:suites[doubleforward,centos-7]'
pup5.5.17-fips:
<<: *pup_5_5_17
<<: *acceptance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'
pup5.5.17-oel:
<<: *pup_5_5_17
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,oel]'
pup5.5.17-oel-fips:
<<: *pup_5_5_17
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,oel]'
pup6:
<<: *pup_6
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,default]'
pup6-fips:
<<: *pup_6
<<: *acceptance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'
pup6-compliance:
# See SIMP-7483
allow_failure: true
<<: *pup_6
<<: *compliance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[compliance,default]'
pup6.16.0:
<<: *pup_6_16_0
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,default]'
pup6.16.0-centos7:
<<: *pup_6_16_0
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'bundle exec rake beaker:suites[default,centos-7]'
pup6.16.0-doubleforward:
<<: *pup_6_16_0
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[doubleforward,default]'
pup6.16.0-centos7-doubleforward:
<<: *pup_6_16_0
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'bundle exec rake beaker:suites[doubleforward,centos-7]'
pup6.16.0-fips:
<<: *pup_6_16_0
<<: *acceptance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'
pup6.16.0-oel:
<<: *pup_6_16_0
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,oel]'
pup6.16.0-oel-fips:
<<: *pup_6_16_0
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,oel]'