This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
182 lines (163 loc) · 4.45 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
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
#
# https://puppet.com/docs/pe/2017.3/overview/component_versions_in_recent_pe_releases.html
# https://puppet.com/misc/puppet-enterprise-lifecycle
# https://puppet.com/docs/pe/2017.3/overview/getting_support_for_pe.html#standard-releases-and-long-term-support-releases
# ------------------------------------------------------------------------------
# release pup ruby eol
# PE 2016.4 4.7 2.1.9 2018-10 (LTS)
# SIMP6.0.0 4.8 2.1.9 TBD
# PE 2017.2 4.10 2.1.9 2018-02-21
# PE 2017.3 5.3 2.4.1 2018-07
# PE 2018.1 ??? ????? ????-?? (LTS)
---
.cache_bundler: &cache_bundler
cache:
untracked: true
# A broad attempt at caching between runs (ala Travis CI)
key: "${CI_PROJECT_NAMESPACE}__bundler"
paths:
- '.vendor'
- 'vendor'
.setup_bundler_env: &setup_bundler_env
before_script:
- 'echo Files in cache: $(find .vendor | wc -l) || :'
- 'export GEM_HOME=.vendor/gem_install'
- 'export BUNDLE_CACHE_PATH=.vendor/bundler'
- 'declare GEM_BUNDLER_VER=(-v ''~> ${BUNDLER_VERSION:-1.16.0}'')'
- declare GEM_INSTALL=(gem install --no-document)
- declare BUNDLER_INSTALL=(bundle install --no-binstubs --jobs $(nproc) --path=.vendor "${FLAGS[@]}")
- gem list -ie "${GEM_BUNDLE_VER[@]}" --silent bundler || "${GEM_INSTALL[@]}" --local "${GEM_BUNDLE_VER[@]}" bundler || "${GEM_INSTALL[@]}" "${GEM_BUNDLE_VER[@]}" bundler
- 'rm -rf pkg/ || :'
- bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL[@]}" --local || "${BUNDLER_INSTALL[@]}")
.validation_checks: &validation_checks
script:
- bundle exec rake syntax
- 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 lint
- bundle exec rake clean
- bundle exec puppet module build
.spec_tests: &spec_tests
script:
- bundle exec rake spec
stages:
- validation
- unit
- acceptance
- deploy
# Puppet 4.7 for PE 2016.4 LTS Support (EOL: 2018-10-21)
# See: https://puppet.com/misc/puppet-enterprise-lifecycle
# --------------------------------------
pup4_7-validation:
stage: validation
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '~> 4.7.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *validation_checks
pup4_7-unit:
stage: unit
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '~> 4.7.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
# Puppet 4.8 for SIMP 6.0 + 6.1 support
# --------------------------------------
pup4_8-validation:
stage: validation
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '~> 4.8.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *validation_checks
pup4_8-unit:
stage: unit
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '~> 4.8.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
# Puppet 4.10 for PE 2017.2 support (EOL:2018-02-21)
# See: https://puppet.com/misc/puppet-enterprise-lifecycle
# --------------------------------------
pup4_10-validation:
stage: validation
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '~> 4.10.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *validation_checks
pup4_10-unit:
stage: unit
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '~> 4.10.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
# Puppet 5.3 for PE 2017.3 support (EOL: 2018-07)
# See: https://puppet.com/misc/puppet-enterprise-lifecycle
# --------------------------------------
pup5_3-validation:
stage: validation
tags:
- docker
image: ruby:2.4
variables:
PUPPET_VERSION: '~> 5.3.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *validation_checks
pup5_3-unit:
stage: unit
tags:
- docker
image: ruby:2.4
variables:
PUPPET_VERSION: '~> 5.3.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
# Keep an eye on the latest puppet 5
# ----------------------------------
pup5_latest-validation:
stage: validation
tags:
- docker
image: ruby:2.4
variables:
PUPPET_VERSION: '~> 5.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *validation_checks
pup5_latest-unit:
stage: unit
tags:
- docker
image: ruby:2.4
variables:
PUPPET_VERSION: '~> 5.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests