-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.html
408 lines (407 loc) · 97.5 KB
/
README.html
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>README</title>
<style>.markdown-preview, .markdown-preview[data-use-github-style] { font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 1.6; word-wrap: break-word; overflow: scroll; box-sizing: border-box; padding: 20px; background-color: rgb(255, 255, 255); }
.markdown-preview > :first-child, .markdown-preview[data-use-github-style] > :first-child { margin-top: 0px !important; }
.markdown-preview > :last-child, .markdown-preview[data-use-github-style] > :last-child { margin-bottom: 0px !important; }
.markdown-preview a:not([href]), .markdown-preview[data-use-github-style] a:not([href]) { color: inherit; text-decoration: none; }
.markdown-preview .absent, .markdown-preview[data-use-github-style] .absent { color: rgb(204, 0, 0); }
.markdown-preview .anchor, .markdown-preview[data-use-github-style] .anchor { position: absolute; top: 0px; left: 0px; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; }
.markdown-preview .anchor:focus, .markdown-preview[data-use-github-style] .anchor:focus { outline: none; }
.markdown-preview h1, .markdown-preview[data-use-github-style] h1, .markdown-preview h2, .markdown-preview[data-use-github-style] h2, .markdown-preview h3, .markdown-preview[data-use-github-style] h3, .markdown-preview h4, .markdown-preview[data-use-github-style] h4, .markdown-preview h5, .markdown-preview[data-use-github-style] h5, .markdown-preview h6, .markdown-preview[data-use-github-style] h6 { position: relative; margin-top: 1em; margin-bottom: 16px; font-weight: bold; line-height: 1.4; }
.markdown-preview h1 .octicon-link, .markdown-preview[data-use-github-style] h1 .octicon-link, .markdown-preview h2 .octicon-link, .markdown-preview[data-use-github-style] h2 .octicon-link, .markdown-preview h3 .octicon-link, .markdown-preview[data-use-github-style] h3 .octicon-link, .markdown-preview h4 .octicon-link, .markdown-preview[data-use-github-style] h4 .octicon-link, .markdown-preview h5 .octicon-link, .markdown-preview[data-use-github-style] h5 .octicon-link, .markdown-preview h6 .octicon-link, .markdown-preview[data-use-github-style] h6 .octicon-link { display: none; color: rgb(0, 0, 0); vertical-align: middle; }
.markdown-preview h1:hover .anchor, .markdown-preview[data-use-github-style] h1:hover .anchor, .markdown-preview h2:hover .anchor, .markdown-preview[data-use-github-style] h2:hover .anchor, .markdown-preview h3:hover .anchor, .markdown-preview[data-use-github-style] h3:hover .anchor, .markdown-preview h4:hover .anchor, .markdown-preview[data-use-github-style] h4:hover .anchor, .markdown-preview h5:hover .anchor, .markdown-preview[data-use-github-style] h5:hover .anchor, .markdown-preview h6:hover .anchor, .markdown-preview[data-use-github-style] h6:hover .anchor { padding-left: 8px; margin-left: -30px; text-decoration: none; }
.markdown-preview h1:hover .anchor .octicon-link, .markdown-preview[data-use-github-style] h1:hover .anchor .octicon-link, .markdown-preview h2:hover .anchor .octicon-link, .markdown-preview[data-use-github-style] h2:hover .anchor .octicon-link, .markdown-preview h3:hover .anchor .octicon-link, .markdown-preview[data-use-github-style] h3:hover .anchor .octicon-link, .markdown-preview h4:hover .anchor .octicon-link, .markdown-preview[data-use-github-style] h4:hover .anchor .octicon-link, .markdown-preview h5:hover .anchor .octicon-link, .markdown-preview[data-use-github-style] h5:hover .anchor .octicon-link, .markdown-preview h6:hover .anchor .octicon-link, .markdown-preview[data-use-github-style] h6:hover .anchor .octicon-link { display: inline-block; }
.markdown-preview h1 tt, .markdown-preview[data-use-github-style] h1 tt, .markdown-preview h2 tt, .markdown-preview[data-use-github-style] h2 tt, .markdown-preview h3 tt, .markdown-preview[data-use-github-style] h3 tt, .markdown-preview h4 tt, .markdown-preview[data-use-github-style] h4 tt, .markdown-preview h5 tt, .markdown-preview[data-use-github-style] h5 tt, .markdown-preview h6 tt, .markdown-preview[data-use-github-style] h6 tt, .markdown-preview h1 code, .markdown-preview[data-use-github-style] h1 code, .markdown-preview h2 code, .markdown-preview[data-use-github-style] h2 code, .markdown-preview h3 code, .markdown-preview[data-use-github-style] h3 code, .markdown-preview h4 code, .markdown-preview[data-use-github-style] h4 code, .markdown-preview h5 code, .markdown-preview[data-use-github-style] h5 code, .markdown-preview h6 code, .markdown-preview[data-use-github-style] h6 code { font-size: inherit; }
.markdown-preview h1, .markdown-preview[data-use-github-style] h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); }
.markdown-preview h1 .anchor, .markdown-preview[data-use-github-style] h1 .anchor { line-height: 1; }
.markdown-preview h2, .markdown-preview[data-use-github-style] h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); }
.markdown-preview h2 .anchor, .markdown-preview[data-use-github-style] h2 .anchor { line-height: 1; }
.markdown-preview h3, .markdown-preview[data-use-github-style] h3 { font-size: 1.5em; line-height: 1.43; }
.markdown-preview h3 .anchor, .markdown-preview[data-use-github-style] h3 .anchor { line-height: 1.2; }
.markdown-preview h4, .markdown-preview[data-use-github-style] h4 { font-size: 1.25em; }
.markdown-preview h4 .anchor, .markdown-preview[data-use-github-style] h4 .anchor { line-height: 1.2; }
.markdown-preview h5, .markdown-preview[data-use-github-style] h5 { font-size: 1em; }
.markdown-preview h5 .anchor, .markdown-preview[data-use-github-style] h5 .anchor { line-height: 1.1; }
.markdown-preview h6, .markdown-preview[data-use-github-style] h6 { font-size: 1em; color: rgb(119, 119, 119); }
.markdown-preview h6 .anchor, .markdown-preview[data-use-github-style] h6 .anchor { line-height: 1.1; }
.markdown-preview p, .markdown-preview[data-use-github-style] p, .markdown-preview blockquote, .markdown-preview[data-use-github-style] blockquote, .markdown-preview ul, .markdown-preview[data-use-github-style] ul, .markdown-preview ol, .markdown-preview[data-use-github-style] ol, .markdown-preview dl, .markdown-preview[data-use-github-style] dl, .markdown-preview table, .markdown-preview[data-use-github-style] table, .markdown-preview pre, .markdown-preview[data-use-github-style] pre { margin-top: 0px; margin-bottom: 16px; }
.markdown-preview hr, .markdown-preview[data-use-github-style] hr { height: 4px; padding: 0px; margin: 16px 0px; border: 0px none; background-color: rgb(231, 231, 231); }
.markdown-preview ul, .markdown-preview[data-use-github-style] ul, .markdown-preview ol, .markdown-preview[data-use-github-style] ol { padding-left: 2em; }
.markdown-preview ul.no-list, .markdown-preview[data-use-github-style] ul.no-list, .markdown-preview ol.no-list, .markdown-preview[data-use-github-style] ol.no-list { padding: 0px; list-style-type: none; }
.markdown-preview ul ul, .markdown-preview[data-use-github-style] ul ul, .markdown-preview ul ol, .markdown-preview[data-use-github-style] ul ol, .markdown-preview ol ol, .markdown-preview[data-use-github-style] ol ol, .markdown-preview ol ul, .markdown-preview[data-use-github-style] ol ul { margin-top: 0px; margin-bottom: 0px; }
.markdown-preview li > p, .markdown-preview[data-use-github-style] li > p { margin-top: 16px; }
.markdown-preview dl, .markdown-preview[data-use-github-style] dl { padding: 0px; }
.markdown-preview dl dt, .markdown-preview[data-use-github-style] dl dt { padding: 0px; margin-top: 16px; font-size: 1em; font-style: italic; font-weight: bold; }
.markdown-preview dl dd, .markdown-preview[data-use-github-style] dl dd { padding: 0px 16px; margin-bottom: 16px; }
.markdown-preview blockquote, .markdown-preview[data-use-github-style] blockquote { padding: 0px 15px; color: rgb(119, 119, 119); border-left-width: 4px; border-left-style: solid; border-left-color: rgb(221, 221, 221); }
.markdown-preview blockquote > :first-child, .markdown-preview[data-use-github-style] blockquote > :first-child { margin-top: 0px; }
.markdown-preview blockquote > :last-child, .markdown-preview[data-use-github-style] blockquote > :last-child { margin-bottom: 0px; }
.markdown-preview table, .markdown-preview[data-use-github-style] table { display: block; width: 100%; overflow: auto; word-break: normal; }
.markdown-preview table th, .markdown-preview[data-use-github-style] table th { font-weight: bold; }
.markdown-preview table th, .markdown-preview[data-use-github-style] table th, .markdown-preview table td, .markdown-preview[data-use-github-style] table td { padding: 6px 13px; border: 1px solid rgb(221, 221, 221); }
.markdown-preview table tr, .markdown-preview[data-use-github-style] table tr { border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(255, 255, 255); }
.markdown-preview table tr:nth-child(2n), .markdown-preview[data-use-github-style] table tr:nth-child(2n) { background-color: rgb(248, 248, 248); }
.markdown-preview img, .markdown-preview[data-use-github-style] img { max-width: 100%; box-sizing: border-box; }
.markdown-preview .emoji, .markdown-preview[data-use-github-style] .emoji { max-width: none; }
.markdown-preview span.frame, .markdown-preview[data-use-github-style] span.frame { display: block; overflow: hidden; }
.markdown-preview span.frame > span, .markdown-preview[data-use-github-style] span.frame > span { display: block; float: left; width: auto; padding: 7px; margin: 13px 0px 0px; overflow: hidden; border: 1px solid rgb(221, 221, 221); }
.markdown-preview span.frame span img, .markdown-preview[data-use-github-style] span.frame span img { display: block; float: left; }
.markdown-preview span.frame span span, .markdown-preview[data-use-github-style] span.frame span span { display: block; padding: 5px 0px 0px; clear: both; color: rgb(51, 51, 51); }
.markdown-preview span.align-center, .markdown-preview[data-use-github-style] span.align-center { display: block; overflow: hidden; clear: both; }
.markdown-preview span.align-center > span, .markdown-preview[data-use-github-style] span.align-center > span { display: block; margin: 13px auto 0px; overflow: hidden; text-align: center; }
.markdown-preview span.align-center span img, .markdown-preview[data-use-github-style] span.align-center span img { margin: 0px auto; text-align: center; }
.markdown-preview span.align-right, .markdown-preview[data-use-github-style] span.align-right { display: block; overflow: hidden; clear: both; }
.markdown-preview span.align-right > span, .markdown-preview[data-use-github-style] span.align-right > span { display: block; margin: 13px 0px 0px; overflow: hidden; text-align: right; }
.markdown-preview span.align-right span img, .markdown-preview[data-use-github-style] span.align-right span img { margin: 0px; text-align: right; }
.markdown-preview span.float-left, .markdown-preview[data-use-github-style] span.float-left { display: block; float: left; margin-right: 13px; overflow: hidden; }
.markdown-preview span.float-left span, .markdown-preview[data-use-github-style] span.float-left span { margin: 13px 0px 0px; }
.markdown-preview span.float-right, .markdown-preview[data-use-github-style] span.float-right { display: block; float: right; margin-left: 13px; overflow: hidden; }
.markdown-preview span.float-right > span, .markdown-preview[data-use-github-style] span.float-right > span { display: block; margin: 13px auto 0px; overflow: hidden; text-align: right; }
.markdown-preview code, .markdown-preview[data-use-github-style] code, .markdown-preview tt, .markdown-preview[data-use-github-style] tt { padding: 0.2em 0px; margin: 0px; font-size: 85%; border-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); }
.markdown-preview code::before, .markdown-preview[data-use-github-style] code::before, .markdown-preview tt::before, .markdown-preview[data-use-github-style] tt::before, .markdown-preview code::after, .markdown-preview[data-use-github-style] code::after, .markdown-preview tt::after, .markdown-preview[data-use-github-style] tt::after { letter-spacing: -0.2em; content: ' '; }
.markdown-preview code br, .markdown-preview[data-use-github-style] code br, .markdown-preview tt br, .markdown-preview[data-use-github-style] tt br { display: none; }
.markdown-preview del code, .markdown-preview[data-use-github-style] del code { text-decoration: inherit; }
.markdown-preview pre > code, .markdown-preview[data-use-github-style] pre > code { padding: 0px; margin: 0px; font-size: 100%; word-break: normal; white-space: pre; border: 0px; background: transparent; }
.markdown-preview .highlight, .markdown-preview[data-use-github-style] .highlight { margin-bottom: 16px; }
.markdown-preview .highlight pre, .markdown-preview[data-use-github-style] .highlight pre, .markdown-preview pre, .markdown-preview[data-use-github-style] pre { padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; border-radius: 3px; background-color: rgb(247, 247, 247); }
.markdown-preview .highlight pre, .markdown-preview[data-use-github-style] .highlight pre { margin-bottom: 0px; word-break: normal; }
.markdown-preview pre, .markdown-preview[data-use-github-style] pre { word-wrap: normal; }
.markdown-preview pre code, .markdown-preview[data-use-github-style] pre code, .markdown-preview pre tt, .markdown-preview[data-use-github-style] pre tt { display: inline; max-width: initial; padding: 0px; margin: 0px; overflow: initial; line-height: inherit; word-wrap: normal; border: 0px; background-color: transparent; }
.markdown-preview pre code::before, .markdown-preview[data-use-github-style] pre code::before, .markdown-preview pre tt::before, .markdown-preview[data-use-github-style] pre tt::before, .markdown-preview pre code::after, .markdown-preview[data-use-github-style] pre code::after, .markdown-preview pre tt::after, .markdown-preview[data-use-github-style] pre tt::after { content: normal; }
.markdown-preview kbd, .markdown-preview[data-use-github-style] kbd { display: inline-block; padding: 3px 5px; font-size: 11px; line-height: 10px; color: rgb(85, 85, 85); vertical-align: middle; border-style: solid; border-width: 1px; border-color: rgb(204, 204, 204) rgb(204, 204, 204) rgb(187, 187, 187); border-radius: 3px; box-shadow: rgb(187, 187, 187) 0px -1px 0px inset; background-color: rgb(252, 252, 252); }
.markdown-preview, .markdown-preview[data-use-github-style], .markdown-preview code, .markdown-preview[data-use-github-style] code { color: rgb(51, 51, 51); }
.markdown-preview h1, .markdown-preview[data-use-github-style] h1, .markdown-preview h2, .markdown-preview[data-use-github-style] h2, .markdown-preview h3, .markdown-preview[data-use-github-style] h3, .markdown-preview h4, .markdown-preview[data-use-github-style] h4, .markdown-preview h5, .markdown-preview[data-use-github-style] h5, .markdown-preview h6, .markdown-preview[data-use-github-style] h6 { -webkit-font-smoothing: antialiased; cursor: text; }
.markdown-preview > h1:first-child, .markdown-preview[data-use-github-style] > h1:first-child, .markdown-preview > h1:first-child + h2, .markdown-preview[data-use-github-style] > h1:first-child + h2, .markdown-preview > h2:first-child, .markdown-preview[data-use-github-style] > h2:first-child, .markdown-preview > h3:first-child, .markdown-preview[data-use-github-style] > h3:first-child, .markdown-preview > h4:first-child, .markdown-preview[data-use-github-style] > h4:first-child, .markdown-preview > h5:first-child, .markdown-preview[data-use-github-style] > h5:first-child, .markdown-preview > h6:first-child, .markdown-preview[data-use-github-style] > h6:first-child { margin-top: 0px; padding-top: 0px; }
.markdown-preview a, .markdown-preview[data-use-github-style] a, .markdown-preview a code, .markdown-preview[data-use-github-style] a code { color: rgb(65, 131, 196); }
.markdown-preview a:first-child h1, .markdown-preview[data-use-github-style] a:first-child h1, .markdown-preview a:first-child h2, .markdown-preview[data-use-github-style] a:first-child h2, .markdown-preview a:first-child h3, .markdown-preview[data-use-github-style] a:first-child h3, .markdown-preview a:first-child h4, .markdown-preview[data-use-github-style] a:first-child h4, .markdown-preview a:first-child h5, .markdown-preview[data-use-github-style] a:first-child h5, .markdown-preview a:first-child h6, .markdown-preview[data-use-github-style] a:first-child h6 { margin-top: 0px; padding-top: 0px; }
.markdown-preview h1 + p, .markdown-preview[data-use-github-style] h1 + p, .markdown-preview h2 + p, .markdown-preview[data-use-github-style] h2 + p, .markdown-preview h3 + p, .markdown-preview[data-use-github-style] h3 + p, .markdown-preview h4 + p, .markdown-preview[data-use-github-style] h4 + p, .markdown-preview h5 + p, .markdown-preview[data-use-github-style] h5 + p, .markdown-preview h6 + p, .markdown-preview[data-use-github-style] h6 + p { margin-top: 0px; }
.markdown-preview li p.first, .markdown-preview[data-use-github-style] li p.first { display: inline-block; }
.markdown-preview ul li > :first-child, .markdown-preview[data-use-github-style] ul li > :first-child, .markdown-preview ol li > :first-child, .markdown-preview[data-use-github-style] ol li > :first-child, .markdown-preview ul li ul:first-of-type, .markdown-preview[data-use-github-style] ul li ul:first-of-type, .markdown-preview ol li ul:first-of-type, .markdown-preview[data-use-github-style] ol li ul:first-of-type { margin-top: 0px; }
.markdown-preview ol > li, .markdown-preview[data-use-github-style] ol > li { list-style-type: decimal; }
.markdown-preview ul > li, .markdown-preview[data-use-github-style] ul > li { list-style-type: disc; }
.markdown-preview dl dt:first-child, .markdown-preview[data-use-github-style] dl dt:first-child { padding: 0px; }
.markdown-preview dl dt > :first-child, .markdown-preview[data-use-github-style] dl dt > :first-child { margin-top: 0px; }
.markdown-preview dl dt > :last-child, .markdown-preview[data-use-github-style] dl dt > :last-child { margin-bottom: 0px; }
.markdown-preview dl dd > :first-child, .markdown-preview[data-use-github-style] dl dd > :first-child { margin-top: 0px; }
.markdown-preview dl dd > :last-child, .markdown-preview[data-use-github-style] dl dd > :last-child { margin-bottom: 0px; }
.markdown-preview blockquote p, .markdown-preview[data-use-github-style] blockquote p { font-size: 16px; line-height: 1.5; }
.markdown-preview pre.editor-colors, .markdown-preview[data-use-github-style] pre.editor-colors { padding: 16px; overflow: auto; font-size: 84%; line-height: 1.45; border-radius: 3px; background-color: rgb(255, 255, 255); }
.markdown-preview pre.editor-colors, .markdown-preview[data-use-github-style] pre.editor-colors { margin-bottom: 16px; word-break: normal; }
.markdown-preview code, .markdown-preview[data-use-github-style] code, .markdown-preview tt, .markdown-preview[data-use-github-style] tt, .markdown-preview pre.editor-colors, .markdown-preview[data-use-github-style] pre.editor-colors { font-family: Consolas, 'Liberation Mono', Courier, monospace; }
.markdown-preview .emoji, .markdown-preview[data-use-github-style] .emoji { height: 20px; width: 20px; }
.bracket-matcher .region {
border-bottom: 1px dotted lime;
position: absolute;
}
pre.editor-colors,
.host {
background-color: #ffffff;
color: #555555;
}
pre.editor-colors .invisible-character,
.host .invisible-character {
color: rgba(85, 85, 85, 0.2);
}
pre.editor-colors .indent-guide,
.host .indent-guide {
color: rgba(85, 85, 85, 0.2);
}
pre.editor-colors .wrap-guide,
.host .wrap-guide {
background-color: rgba(85, 85, 85, 0.2);
}
pre.editor-colors .gutter,
.host .gutter {
color: #555555;
background: #ffffff;
}
pre.editor-colors .gutter .line-number.folded,
.host .gutter .line-number.folded,
pre.editor-colors .gutter .line-number:after,
.host .gutter .line-number:after,
pre.editor-colors .fold-marker:after,
.host .fold-marker:after {
color: #e87b00;
}
pre.editor-colors .invisible,
.host .invisible {
color: #555;
}
pre.editor-colors .selection .region,
.host .selection .region {
background-color: #e1e1e1;
}
pre.editor-colors.is-focused .cursor,
.host.is-focused .cursor {
border-color: #000000;
}
pre.editor-colors.is-focused .selection .region,
.host.is-focused .selection .region {
background-color: #afc4da;
}
pre.editor-colors.is-focused .line-number.cursor-line-no-selection,
.host.is-focused .line-number.cursor-line-no-selection,
pre.editor-colors.is-focused .line.cursor-line,
.host.is-focused .line.cursor-line {
background-color: rgba(255, 255, 134, 0.34);
}
pre.editor-colors .source.gfm,
.host .source.gfm {
color: #444;
}
pre.editor-colors .gfm .markup.heading,
.host .gfm .markup.heading {
color: #111;
}
pre.editor-colors .gfm .link,
.host .gfm .link {
color: #888;
}
pre.editor-colors .gfm .variable.list,
.host .gfm .variable.list {
color: #888;
}
pre.editor-colors .markdown .paragraph,
.host .markdown .paragraph {
color: #444;
}
pre.editor-colors .markdown .heading,
.host .markdown .heading {
color: #111;
}
pre.editor-colors .markdown .link,
.host .markdown .link {
color: #888;
}
pre.editor-colors .markdown .link .string,
.host .markdown .link .string {
color: #888;
}
.host(.is-focused) .cursor {
border-color: #000000;
}
.host(.is-focused) .selection .region {
background-color: #afc4da;
}
.host(.is-focused) .line-number.cursor-line-no-selection,
.host(.is-focused) .line.cursor-line {
background-color: rgba(255, 255, 134, 0.34);
}
.comment {
color: #999988;
font-style: italic;
}
.string {
color: #D14;
}
.string .source,
.string .meta.embedded.line {
color: #5A5A5A;
}
.string .punctuation.section.embedded {
color: #920B2D;
}
.string .punctuation.section.embedded .source {
color: #920B2D;
}
.constant.numeric {
color: #D14;
}
.constant.language {
color: #606aa1;
}
.constant.character,
.constant.other {
color: #606aa1;
}
.constant.symbol {
color: #990073;
}
.constant.numeric.line-number.find-in-files .match {
color: rgba(143, 190, 0, 0.63);
}
.variable {
color: #008080;
}
.variable.parameter {
color: #606aa1;
}
.keyword {
color: #222;
font-weight: bold;
}
.keyword.unit {
color: #445588;
}
.keyword.special-method {
color: #0086B3;
}
.storage {
color: #222;
}
.storage.type {
color: #222;
}
.entity.name.class {
text-decoration: underline;
color: #606aa1;
}
.entity.other.inherited-class {
text-decoration: underline;
color: #606aa1;
}
.entity.name.function {
color: #900;
}
.entity.name.tag {
color: #008080;
}
.entity.other.attribute-name {
color: #458;
font-weight: bold;
}
.entity.name.filename.find-in-files {
color: #E6DB74;
}
.support.constant,
.support.function,
.support.type {
color: #458;
}
.support.class {
color: #008080;
}
.invalid {
color: #F8F8F0;
background-color: #00A8C6;
}
.invalid.deprecated {
color: #F8F8F0;
background-color: #8FBE00;
}
.meta.structure.dictionary.json > .string.quoted.double.json,
.meta.structure.dictionary.json > .string.quoted.double.json .punctuation.string {
color: #000080;
}
.meta.structure.dictionary.value.json > .string.quoted.double.json {
color: #d14;
}
.meta.diff,
.meta.diff.header {
color: #75715E;
}
.css.support.property-name {
font-weight: bold;
color: #333;
}
.css.constant {
color: #099;
}
.bracket-matcher .region {
background-color: #C9C9C9;
opacity: .7;
border-bottom: 0 none;
}
</style>
</head>
<body class='markdown-preview'><h1 id="workshop-docker-jenkins-startpoint">workshop-docker-jenkins-startpoint</h1>
<p>Startpoint for participants in the workshop</p>
<h2 id="prerequisites-">Prerequisites:</h2>
<ul>
<li>VirtualBox: <a href="https://www.virtualbox.org/wiki/Downloads">https://www.virtualbox.org/wiki/Downloads</a></li>
<li>Vagrant: <a href="http://www.vagrantup.com/downloads.html">https://www.virtualbox.org/wiki/Downloads</a></li>
</ul>
<h3 id="on-windows-machines-">On Windows machines**:</h3>
<ul>
<li>Git bash: <a href="https://msysgit.github.io/">https://msysgit.github.io/</a> or other package providing ssh. Ensure that the path containing the ssh.exe file is in your system PATH (ie.: <code>set PATH=%PATH%;C:\Program Files (x86)\Git\bin</code>)</li>
</ul>
<h2 id="getting-started">Getting Started</h2>
<ul>
<li>Copy contents of the usb drive to your local disk</li>
<li>Open a (unix/bash) shell and go to the 'workshop-docker-jenkins' directory</li>
<li>Type 'vagrant up'</li>
<li>Wait...</li>
<li>Type 'vagrant ssh'</li>
</ul>
<p>You should now be logged into the virtual machine.</p>
<h3 id="basic-docker-commands">Basic Docker commands</h3>
<p>Within the virtual machine, docker should be running. Let's try:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>$</span><span class="keyword operator redirect shell"><span>></span></span><span> docker ps</span></span></div></pre>
<p>You should get a response that looks like this:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>vagrant@vagrant-ubuntu-vivid-64:</span><span class="keyword operator tilde shell"><span>~</span></span><span>$ docker ps</span></span></div><div class="line"><span class="source shell"><span>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span></span></div></pre>
<p><strong>Note</strong>: if you get a response that looks like this:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS</span><span class="keyword operator glob shell"><span>?</span></span></span></div></pre>
<p>simply restart the docker daemon in the vm by typing:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>sudo service docker restart</span></span></div></pre>
<h3 id="starting-containers">Starting containers</h3>
<p>Let's start a container. To start jenkins within the vm, type:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>docker run -d -v /home/vagrant/.m2:/root/.m2 -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 --name jenkins wouterla/docker-jenkins</span></span></div></pre>
<p>See <a href="https://docs.docker.com/reference/commandline/cli/">https://docs.docker.com/reference/commandline/cli/</a> for the documentation of the docker run command. What we are using here is:</p>
<ul>
<li><strong>-d</strong> - run this container in the background</li>
<li><strong>-v host-dir:container-dir</strong> - mount a file or directory from the host (our vm) to the docker container. We mount the pre-filled maven repository, to avoid having to download the internet, and we mount the docker socket so jenkins will be able to start other containers.</li>
<li><strong>-p host-port:container-port</strong> - expose a port from the container to the outside</li>
<li><strong>--name a-name</strong> - a name we can use to refer to this container</li>
<li><strong>repository/name:tag</strong> - the name/location of the docker image</li>
</ul>
<p>Now that we've started jenkins, we can check that it is running by typing:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>docker ps</span></span></div></pre>
<p>again, this time we should get something like:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>vagrant@vagrant-ubuntu-vivid-64:</span><span class="keyword operator tilde shell"><span>~</span></span><span>$ docker ps</span></span></div><div class="line"><span class="source shell"><span>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span></span></div><div class="line"><span class="source shell"><span>27c0e62bfbaa wouterla/docker-jenkins:latest </span><span class="string quoted double shell"><span class="punctuation definition string begin shell"><span>"</span></span><span>/bin/sh -c 'java -j 23 seconds ago Up 22 seconds 0.0.0.0:8080->8080/tcp jenkins</span></span></span></div></pre>
<p>Now you can access jenkins by opening <a href="http://localhost:9080">http://localhost:9080</a>. We are not accessing the docker image, or port, directly. There is yet another level of port forwarding used to link the vagrant vm to your local network. Check the Vagrantfile to see how that's done. We are forwarding port 8080 on the vagrant machine to port 9080 on your local machine. And 8081->9081, 8082->9082, 8083->9083.</p>
<p>But this jenkins is still empty. No job have been defined yet. We will not be adding any jobs or configuration to jenkins by hand. To see how jobs are defined, have a look at the definitions in <a href="roles/jenkins-jobs/jobs/jobs.yml">roles/jenkins-jobs/jobs/jobs.yml</a>.</p>
<p>Those jobs are packaged in a separate docker image, together with the means to add them tdocker run --link jenkins:jenkins wouterla/docker-jenkins-job-builder o jenkins: <a href="jenkins-job-builder">http://docs.openstack.org/infra/jenkins-job-builder/</a>. A few jobs are pre-packaged, and you can add them to jenkins by running:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>docker run --link jenkins:jenkins wouterla/docker-jenkins-job-builder</span></span></div></pre>
<p>You can see that we have a new switch to the docker 'run' command, here:</p>
<ul>
<li><strong>--link container-name:alias</strong> - we link an existing, running, container to the new one, and give it a name. For our current purposes, this means that the jenkins container's ip address will be added to the 'hosts' file of the new container with the hostname 'jenkins'.</li>
</ul>
<p>When this container is run, you see the output of the main process (<code>jenkins-jobs</code>) on the command-line. This process runs it course and then returns, stopping the container.</p>
<p>Now, you can see three pre-defined jobs in jenkins, 'petclinic-start', 'petclinic-test' and 'done'. Start 'petclinic-start', and switch to the 'pipelines' view to see the basic pipeline working.</p>
<h3 id="adding-jobs">Adding jobs</h3>
<p>To add a job to our build pipelins, we need a new job-template, and to call that template from our project<img class="emoji" title=":x:" alt="x" src="/opt/atom/resources/app.asar/node_modules/roaster/node_modules/emoji-images/pngs/x.png" height="20"></p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>job-template</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}-package</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>builders</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>maven-target</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>goals</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{goals}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<p>Note that we don't have to do anything to configure the git repository, since that is all coming from the defaults.</p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-package'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>goals</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>install</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>done</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<p>Don't forget to also update the <code>next-job</code> from the test job to point to this new 'petclinic-package' job!</p>
<h3 id="building-containers">Building containers</h3>
<p>To build a new version of the jenkins-job-builder container, we need to use the docker build command. The script <a href="build_docker_jenkins_job_builder.sh">build_docker_jenkins_job_builder.sh</a> shows all the steps, but the only one specific to building the container is:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>docker build -t wouterla/docker-jenkins-job-builder </span><span class="support function builtin shell"><span>.</span></span></span></div></pre>
<p>Again, we see the format of the 'tag', comprising of the repository (wouterla), the name (docker-jenkins-job-builder) and the tag (not given, so defaulting to 'latest'). This form of the command assumes all related files are in the current directory (the '.' at the end). See the full documentation <a href="on the docker site">https://docs.docker.com/reference/commandline/cli/#build</a>.</p>
<p>In the context of this workshop, simply run the script.</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>./build_docker_jenkins_job_builder.sh</span></span></div></pre>
<p>Then, re-run the job-builder container to add the new job to jenkins:</p>
<pre class="editor-colors lang-shell"><div class="line"><span class="source shell"><span>docker run --link jenkins:jenkins wouterla/docker-jenkins-job-builder</span></span></div></pre>
<h3 id="creating-a-dockerfile">Creating a Dockerfile</h3>
<p>To be able to deploy the demo app, we need to complete the Dockerfile. The Dockerfile in your <a href="spring-petclinic/docker">spring-petclinic/docker</a> directory is incomplete. It specifies the base image (docker-base) that contains usefull things, like a java runtime. To make it install the jetty-runner app, and run our petclinit example application from the war generated by the maven install goal, change it to:</p>
<pre class="editor-colors lang-docker"><div class="line"><span class="text plain null-grammar"><span>FROM wouterla/docker-base</span></span></div><div class="line"><span class="text plain null-grammar"><span>MAINTAINER Wouter Lagerweij <[email protected]></span></span></div><div class="line"><span class="text plain null-grammar"><span> </span></span></div><div class="line"><span class="text plain null-grammar"><span># Normally we'd retrieve the jetty-runner jar directly from the internet,</span></span></div><div class="line"><span class="text plain null-grammar"><span># but we want to make sure we don't overtax conference wifi, so it's included</span></span></div><div class="line"><span class="text plain null-grammar"><span># in the image</span></span></div><div class="line"><span class="text plain null-grammar"><span># RUN curl -L </span><span class="markup underline link http hyperlink"><span>http://repo2.maven.org/maven2/org/mortbay/jetty/jetty-runner/8.1.9.v20130131/jetty-runner-8.1.9.v20130131.jar</span></span><span> -o jetty-runner.jar</span></span></div><div class="line"><span class="text plain null-grammar"><span> </span></span></div><div class="line"><span class="text plain null-grammar"><span>RUN mkdir -p /opt/jetty</span></span></div><div class="line"><span class="text plain null-grammar"><span>WORKDIR /opt/jetty</span></span></div><div class="line"><span class="text plain null-grammar"><span>ADD jetty-runner.jar ./</span></span></div><div class="line"><span class="text plain null-grammar"><span> </span></span></div><div class="line"><span class="text plain null-grammar"><span>ADD petclinic.war ./</span></span></div><div class="line"><span class="text plain null-grammar"><span> </span></span></div><div class="line"><span class="text plain null-grammar"><span>CMD java -jar jetty-runner.jar petclinic.war</span></span></div></pre>
<h3 id="add-the-building-of-the-docker-image-to-the-jenkins-pipeline">Add the building of the docker image to the jenkins pipeline</h3>
<p>For this we need to have the contents of the build_docker_petclinic.sh script within the jenkins-job-builder yaml. In other circumstances we could also call the existing script, or even add the building of the docker image to maven using <a href="the maven docker plugin">https://github.com/spotify/docker-maven-plugin</a>, but for the purposes of understanding what's going on in this process, we'll make it explicit:</p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>job-template</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}-create-docker-image</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>builders</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>maven-target</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>goals</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>clean install</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span class="string unquoted block yaml"><span> </span><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>shell</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> |</span></span></span></div><div class="line"><span class="source yaml"><span class="punctuation whitespace comment leading yaml"><span> </span></span><span class="comment line number-sign yaml"><span class="punctuation definition comment yaml"><span>#</span></span><span>!/bin/bash</span><span> </span></span></span></div><div class="line"><span class="source yaml"><span> set </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>v</span></span></span></span></div><div class="line"><span class="source yaml"><span> set </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>e</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span></span></div><div class="line"><span class="source yaml"><span> echo </span><span class="string quoted double yaml"><span class="punctuation definition string begin yaml"><span>"</span></span><span>Copying docker files</span><span class="punctuation definition string end yaml"><span>"</span></span></span></span></div><div class="line"><span class="source yaml"><span> cp docker/* target/</span></span></div><div class="line"><span class="source yaml"><span> </span></span></div><div class="line"><span class="source yaml"><span> echo </span><span class="string quoted double yaml"><span class="punctuation definition string begin yaml"><span>"</span></span><span>Running docker</span><span class="punctuation definition string end yaml"><span>"</span></span></span></span></div><div class="line"><span class="source yaml"><span> cd target/</span></span></div><div class="line"><span class="source yaml"><span> docker build </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>t wouterla/docker-petclinic .</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span></span></div><div class="line"><span class="source yaml"><span class="punctuation whitespace comment leading yaml"><span> </span></span><span class="comment line number-sign yaml"><span class="punctuation definition comment yaml"><span>#</span></span><span>echo "Pushing docker image to repository"</span><span> </span></span></span></div><div class="line"><span class="source yaml"><span class="punctuation whitespace comment leading yaml"><span> </span></span><span class="comment line number-sign yaml"><span class="punctuation definition comment yaml"><span>#</span></span><span>docker push wouterla/docker-jenkins</span><span> </span></span></span></div></pre>
<p>Note the use of the pipe ('|') symbol to include multiple lines of pre-formatted code. A default yaml feature.</p>
<p>Note that we're not pushing the image to the repository. You'd need to login, and have a fast internet connection to do so. Adding this job-template to our project is similar to our previous change. The project will now look somewhat like this:</p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="entity name tag yaml"><span>jobs</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-start'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-test'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>goals</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-package</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-package'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>goals</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>install</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-create-docker-image</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-create-docker-image'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>done</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<h3 id="deploy-the-container-from-our-pipeline">Deploy the container from our pipeline</h3>
<p>Now that we've built our container for the petclinic, it's time to deploy it on a 'test environment'!</p>
<p>We can deploy the container using the docker run command in another shell builder. Since I'd like to be able to deploy to a 'production environment' as well, we do a little parametrisation, and use a macro for the builder:</p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>builder</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string unquoted yaml"><span>deploy</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>builders</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span class="string unquoted block yaml"><span> </span><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>shell</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> |</span></span></span></div><div class="line"><span class="source yaml"><span class="punctuation whitespace comment leading yaml"><span> </span></span><span class="comment line number-sign yaml"><span class="punctuation definition comment yaml"><span>#</span></span><span>!/bin/bash</span><span> </span></span></span></div><div class="line"><span class="source yaml"><span> set </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>v</span></span></span></span></div><div class="line"><span class="source yaml"><span> set +e </span><span class="comment line number-sign yaml"><span class="punctuation definition comment yaml"><span>#</span></span><span>the next step can return error code if no container is running</span><span> </span></span></span></div><div class="line"><span class="source yaml"><span> docker kill {name}</span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>{env} && docker rm {name}-{env}</span></span></span></span></div><div class="line"><span class="source yaml"><span> set </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>e</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="meta tag yaml"><span class="entity name tag yaml"><span>docker run -d -p {external-port}</span></span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span>{internal</span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>port} --name {name}-{env} wouterla/docker-{name}</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span></span></div><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>job-template</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}-deploy-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>builders</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>deploy</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>env</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{env}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{external-port}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>internal-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{internal-port}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<p>Using different ports allows us to deploy multiple copies of the same container on one docker node. In real life, we'd probable be more comfortable using different nodes for production and test, and perhaps set a 'DOCKER_HOST' variable for each environment, or use ansible's docker module to start the containers on different hosts.</p>
<p><strong>Note</strong>: We have to pass-through the parameters explicitly, even though they have the same name in the project, template and macro. This is a feature (?) of jenkins job builder that I've not been able to work around.</p>
<p>The project should not contain something like:</p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>project</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string unquoted yaml"><span>petclinic</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>gitrepo</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>spring-petclinic</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>branch</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>master</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>internal-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>8080</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>jobs</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> ...</span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-create-docker-image'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-deploy-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-deploy-test'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>8081</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>env</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>done</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<p>Since the internal port is always the same, we can define that one on a project level.</p>
<p>Also, not that we now have set the <code>pipeline-stage</code> to <code>test</code>, since we're actually deploying to a test environment.</p>
<h3 id="a-test-">A test?</h3>
<p>Since this is a demo, we don't have to run any real integration tests here. On the other hand, before we deploy to 'production', it would be nice to know that our container actually started successfully. So let's put in a very simple test:</p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>builder</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string unquoted yaml"><span>integration-test</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>builders</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span class="string unquoted block yaml"><span> </span><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>shell</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> |</span></span></span></div><div class="line"><span class="source yaml"><span class="punctuation whitespace comment leading yaml"><span> </span></span><span class="comment line number-sign yaml"><span class="punctuation definition comment yaml"><span>#</span></span><span>!/bin/bash</span><span> </span></span></span></div><div class="line"><span class="source yaml"><span> set </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>v</span></span></span></span></div><div class="line"><span class="source yaml"><span> set </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>e</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="meta tag yaml"><span class="entity name tag yaml"><span>URL=http</span></span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span>//{</span><span class="meta tag yaml"><span class="entity name tag yaml"><span>host}</span></span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span>{external</span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>port}/vets.html</span></span></span></span></div><div class="line"><span class="source yaml"><span> sleep 10</span></span></div><div class="line"><span class="source yaml"><span> curl </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>-</span></span><span class="string unquoted yaml"><span>-retry 10 --retry-max-time 10 --retry-delay 1 --output /dev/null --silent --head --fail ${{URL}}</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span></span></div><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>job-template</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}-test-integration-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>builders</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>integration-test</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>host</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{host}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{external-port}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<h3 id="production">Production</h3>
<p>Now we can add a production stage. We can easily copy the -test job-templates, and fill in the environment and ports for production. We could probably do this with a little less duplication by employing the job-group concept from job builder, but within the confines of the workshop, we'll stick to copy-past.</p>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>job-template</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}-deploy-production</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>builders</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>deploy</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>env</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{env}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{external-port}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>internal-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{internal-port}</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<pre class="editor-colors lang-yaml"><div class="line"><span class="source yaml"><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>project</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>name</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string unquoted yaml"><span>petclinic</span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>gitrepo</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>spring-petclinic</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>branch</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>master</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>internal-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>8080</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>host</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>10.0.2.15</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>jobs</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-start'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-test'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>goals</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>install</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-create-docker-image</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-create-docker-image'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>build</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-deploy-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-deploy-test'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>8081</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>env</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-test-integration-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-test-integration-test'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>8081</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>env</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>{name}-deploy-production</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-deploy-production'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>production</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>8082</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>env</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>production</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>petclinic-production-integration-test</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="punctuation definition entry yaml"><span>- </span></span><span class="entity name tag yaml"><span>'{name}-production-integration-test'</span><span class="punctuation separator key-value yaml"><span>:</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>pipeline-stage</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>production</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>external-port</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>8082</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>env</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>production</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div><div class="line"><span class="source yaml"><span> </span><span class="string unquoted yaml"><span class="entity name tag yaml"><span>next-job</span><span class="punctuation separator key-value yaml"><span>:</span></span></span><span> </span><span class="string quoted single yaml"><span class="punctuation definition string begin yaml"><span>'</span></span><span>done</span><span class="punctuation definition string end yaml"><span>'</span></span></span></span></span></div></pre>
<h3 id="another-service-">Another service?</h3>
<p>A good exercise would be to add another service to this system. Since most java services would use the same build scripts, and only different names for the docker image (and different git repository and ports), in many cases it would be enough to simply add a new project, and re-use all the existing job-templates.</p>
<p>For the workshop context, you could try to deploy a different branch of the petclinic code.</p></body>
</html>