-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
213 lines (203 loc) · 5.7 KB
/
Jenkinsfile
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
#!groovy
@Library('cicd-lib')
import vdmtl.cicd.*
import jenkins.model.*
pipeline = new Pipeline()
// For more information on the configuration options,
// see https://bitbucket.org/villemontreal/cicd-lib/src/master/docs/Config.md
ctx = pipeline.createContext([
// Namespaces are used in K8s to group similar microservices together.
// For example, if two APIs and a SPA are used to provide the complete application
// they should all use the same namespace.
namespace: [
'sn',
'boite-outils',
],
application: [
name: 'boite-outils4-web',
tier: 'frontend',
runtime: 'nodejs',
framework: 'angular',
keywords: [
'boite-outils',
'web',
'lib',
],
type: 'service',
description: 'boite-outils4-web',
icon: 'https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/svgs/fi-lightbulb.svg',
],
packaging: [
dockerfilePath: './Dockerfile',
],
execution: [
service: [
port: 3000
],
resources: [
minCpu: '100m',
minMemory: '150Mi',
maxCpu: '1000m',
maxMemory: '1000Mi',
],
autoScaling: [
// K8s will start more containers of your application when the current ones
// reach the cpuUsagePercentage limit set below.
// minReplicas indicates the minimum number of instances of containers of
// your app, while maxReplicas is the maximum K8s will be allowed to start.
// NOTE: It is the responsibility of your application to synchronize its
// data between multiple replicas. If your application does not support
// such scaling, set both Replicas values to 1.
minReplicas: 1,
maxReplicas: 1,
cpuUsagePercentage: 50
],
probes: [
liveness: [
enabled: false,
path: '/',
],
readiness: [
enabled: false,
path: '/',
],
],
monitoring: [
enabled: false,
path: '/',
],
],
ingress: [
overrides: [
dev: [
hosts: [
[
uri: 'services.kube.dev.ile.montreal.qc.ca',
paths: [
'/boite-outils4',
],
],
[
uri: 'services.dev.interne.montreal.ca',
paths: [
'/boite-outils4',
],
],
],
],
accept: [
hosts: [
[
uri: 'services.kube.acc.ile.montreal.qc.ca',
paths: [
'/boite-outils4',
],
],
[
uri: 'services.accept.montreal.ca',
paths: [
'/boite-outils4',
],
],
],
],
prod: [
hosts: [
[
uri: 'services.kube.ile.montreal.qc.ca',
paths: [
'/boite-outils4',
],
],
[
uri: 'services.montreal.ca',
paths: [
'/boite-outils4',
],
],
],
],
],
],
notifications: [
chat: [
room: 'boîte-à-outils-web',
notify: true
],
mail: [
to: [
'tola.sam',
'alexis.boulerice'
],
],
],
approvers: [
enabled: true,
overrides: [
accept: [
approvers: [
'G-UNIX-Jenkins-Admin',
'udall98',
'usamtol',
'utamtra',
'uboul8b',
'udesm8n',
'ujanezx',
],
],
prod: [
approvers: [
'G-UNIX-Jenkins-Admin',
'utamtra',
'uboul8b',
'udesm8n',
'ujanezx',
],
],
],
],
debug: true,
approval: [
enabled: true,
overrides: [
accept: [
approvers: [
'G-UNIX-Jenkins-Admin',
'udall98',
'usamtol',
'utamtra',
'uboul8b',
'udesm8n',
'ujanezx',
],
],
prod: [
approvers: [
'G-UNIX-Jenkins-Admin',
'utamtra',
'uboul8b',
'udesm8n',
'ujanezx',
],
],
],
],
])
pipeline.start(ctx) {
pipeline.withSourceCode(ctx) {
pipeline.buildStage(ctx) {
pipeline.buildDockerImage(ctx)
}
pipeline.prePublishStage(ctx) {
pipeline.publishDraftDockerImage(ctx)
}
}
pipeline.withDraftDockerImage(ctx) {
pipeline.publishStage(ctx) {
pipeline.publishDockerImage(ctx)
}
pipeline.deployStage(ctx) {
pipeline.deployApp(ctx)
}
}
}