-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
155 lines (137 loc) · 2.81 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
---
# Example of a CI/CD pipeline for a Puppet module
# Pipeline runs on main and merge_requests, but not on tags.
#
stages:
- 🚦 QA
- 🚥 Test
variables:
# Use internal default Rakefile, to make sure we have a working version
RAKE: rake -f /Rakefile
default:
image:
name: ghcr.io/voxpupuli/voxbox:7.34.0-main
entrypoint: [""]
### Templates #################################################################
.default_rules:
rules:
- &puppetfile
if: '$CI_COMMIT_TAG == null'
exists:
- 'Puppetfile'
changes:
- 'Puppetfile'
### 🚦 QA ######################################################################
.qa:
stage: 🚦 QA
qa-check:
extends: .qa
script:
- $RAKE check
rules:
- if: '$CI_COMMIT_TAG == null'
qa-lint:
extends: .qa
script:
- $RAKE voxpupuli:custom:lint_all
rules:
- if: '$CI_COMMIT_TAG == null'
changes:
- '**/*.pp'
qa-yamllint:
extends: .qa
script:
- yamllint data/
rules:
- if: '$CI_COMMIT_TAG == null'
changes:
- 'data/**/*.yaml'
qa-metadata_lint:
extends: .qa
script:
- $RAKE metadata_lint
rules:
- if: '$CI_COMMIT_TAG == null'
changes:
- metadata.json
qa-rubocop:
extends: .qa
script:
- $RAKE rubocop
rules:
- if: '$CI_COMMIT_TAG == null'
changes:
- '**/*.rb'
qa-strings:
extends: .qa
script:
- $RAKE strings:validate:reference
rules:
- if: '$CI_COMMIT_TAG == null'
exists:
- REFERENCE.md
qa-syntax:
extends: .qa
script:
- $RAKE syntax
rules:
- if: '$CI_COMMIT_TAG == null'
changes:
- 'data/**/*.yaml'
- 'manifests/**/*.pp'
- 'plans/**/*.pp'
- 'templates/**/*.epp'
- 'templates/**/*.erb'
qa-r10k-syntax:
extends: .qa
script:
- $RAKE r10k:syntax
rules:
- *puppetfile
qa-r10k-duplicates:
extends: .qa
script:
- $RAKE r10k:duplicates
rules:
- *puppetfile
qa-r10k-validate:
extends: .qa
script:
- $RAKE r10k:validate
rules:
- *puppetfile
### 🚥 Test ####################################################################
.test:
stage: 🚥 Test
test-unit:
extends: .test
script:
- $RAKE spec
rules:
- if: '$CI_COMMIT_TAG == null'
changes:
- 'data/**/*.yaml'
- 'manifests/**/*.pp'
- 'plans/**/*.pp'
- 'spec/**/*_spec.rb'
- 'templates/**/*.epp'
- 'templates/**/*.erb'
test-r10k-install:
extends: .test
script:
- $RAKE r10k:install
rules:
- *puppetfile
test-acceptance:
extends: .test
script:
- $RAKE beaker
rules:
- if: '$CI_COMMIT_TAG == null'
changes:
- 'data/**/*.yaml'
- 'manifests/**/*.pp'
- 'plans/**/*.pp'
- 'spec/**/*_spec.rb'
- 'templates/**/*.epp'
- 'templates/**/*.erb'