fix naming on dev env integration tests and remove ghprb based dev env integration...
[infra/cicd.git] / jjb / global / jjb-macros.yaml
1 ---
2 # these parameters are used for setting the Gerrit Project on Nordix
3 - parameter:
4     name: project-parameters
5     parameters:
6       - string:
7           name: PROJECT
8           default: '{project}'
9           description: JJB configured PROJECT parameter to identify a Nordix Gerrit project
10       - string:
11           name: BRANCH
12           default: '{branch}'
13           description: "JJB configured BRANCH parameter (e.g. master, nordix-dev)"
14
15 # these parameters are used for streaming changes from various Gerrit Systems
16 - parameter:
17     name: nordix-gerrit-parameters
18     parameters:
19       - string:
20           name: GERRIT_USER
21           default: infra
22           description: Non-interactive user to stream Gerrit Events on Nordix Gerrit
23       - string:
24           name: GIT_BASE_HTTPS
25           default: https://gerrit.nordix.org
26           description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo
27       - string:
28           name: GIT_BASE_SSH
29           default: ssh://$GERRIT_USER@gerrit.nordix.org:29418
30           description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo
31
32 - parameter:
33     name: onap-gerrit-parameters
34     parameters:
35       - string:
36           name: GERRIT_USER
37           default: nordix
38           description: Non-interactive user to stream Gerrit Events on ONAP Gerrit
39       - string:
40           name: GIT_BASE_HTTPS
41           default: https://gerrit.onap.org/r/p
42           description: HTTPS URL to Project Repo on ONAP Gerrit to clone repo
43       - string:
44           name: GIT_BASE_SSH
45           default: ssh://$GERRIT_USER@gerrit.onap.org:29418
46           description: SSH URL to Project Repo on ONAP Gerrit to clone repo
47
48 - parameter:
49     name: acumos-gerrit-parameters
50     parameters:
51       - string:
52           name: GERRIT_USER
53           default: nordix
54           description: Non-interactive user to stream Gerrit Events on Acumos Gerrit
55       - string:
56           name: GIT_BASE_HTTPS
57           default: https://gerrit.acumos.org/r/p
58           description: HTTPS URL to Project Repo on Acumos Gerrit to clone repo
59       - string:
60           name: GIT_BASE_SSH
61           default: ssh://$GERRIT_USER@gerrit.acumos.org:29418
62           description: SSH URL to Project Repo on Acumos Gerrit to clone repo
63
64 - parameter:
65     name: odl-gerrit-parameters
66     parameters:
67       - string:
68           name: GERRIT_USER
69           default: nordix
70           description: Non-interactive user to stream Gerrit Events on ODL Gerrit
71       - string:
72           name: GIT_BASE_HTTPS
73           default: https://git.opendaylight.org/gerrit
74           description: HTTPS URL to Project Repo on OODL Gerrit to clone repo
75       - string:
76           name: GIT_BASE_SSH
77           default: ssh://$GERRIT_USER@git.opendaylight.org:29418
78           description: SSH URL to Project Repo on ODL Gerrit to clone repo
79
80 - parameter:
81     name: opendev-gerrit-parameters
82     parameters:
83       - string:
84           name: GERRIT_USER
85           default: nordix
86           description: Non-interactive user to stream Gerrit Events on OpenDev Gerrit
87       - string:
88           name: GIT_BASE_HTTPS
89           default: https://review.opendev.org
90           description: HTTPS URL to Project Repo on OpenDev Gerrit to clone repo
91       - string:
92           name: GIT_BASE_SSH
93           default: ssh://$GERRIT_USER@review.opendev.org:29418
94           description: SSH URL to Project Repo on OpenDev Gerrit to clone repo
95
96 - parameter:
97     name: oransc-gerrit-parameters
98     parameters:
99       - string:
100           name: GERRIT_USER
101           default: nordix
102           description: Non-interactive user to stream Gerrit Events on ORAN-SC Gerrit
103       - string:
104           name: GIT_BASE_HTTPS
105           default: https://gerrit.o-ran-sc.org/r
106           description: HTTPS URL to Project Repo on ORAN-SC Gerrit to clone repo
107       - string:
108           name: GIT_BASE_SSH
109           default: ssh://$GERRIT_USER@gerrit.o-ran-sc.org:29418
110           description: SSH URL to Project Repo on ORAN-SC Gerrit to clone repo
111
112 - parameter:
113     name: fdio-gerrit-parameters
114     parameters:
115       - string:
116           name: GERRIT_USER
117           default: nordix
118           description: Non-interactive user to stream Gerrit Events on Fast Data Project Gerrit
119       - string:
120           name: GIT_BASE_HTTPS
121           default: https://gerrit.fd.io/r
122           description: HTTPS URL to Project Repo on Fast Data Project Gerrit to clone repo
123       - string:
124           name: GIT_BASE_SSH
125           default: ssh://$GERRIT_USER@gerrit.fd.io:29418
126           description: SSH URL to Project Repo on Fast Data Project Gerrit to clone repo
127
128 # Verify job for Geode git tags to make sure there are in agreed format
129 - builder:
130     name: 'verify-geode-tag-macro'
131     builders:
132       - shell:
133           !include-raw: ./verify_geode_tag.sh
134
135 - builder:
136     name: 'wait-pkg-mgr-macro'
137     builders:
138       - shell:
139           !include-raw: ./scripts/wait-for-pkg-manager.sh
140
141 # defaults for job build history
142 - property:
143     name: logrotate-default
144     properties:
145       - build-discarder:
146           days-to-keep: 60
147           num-to-keep: 200
148           artifact-days-to-keep: 60
149           artifact-num-to-keep: 200
150
151 # defaults for SCM, Gerrit and GitHub
152 - scm:
153     name: git-scm
154     scm:
155       - git:
156           url: '$GIT_BASE_SSH/$PROJECT'
157           credentials-id: '{ssh-credentials-id}'
158           branches:
159             - 'refs/heads/{branch}'
160           refspec: '{refspec}'
161           timeout: 15
162           per-build-tag: false
163           skip-tag: true
164           shallow-clone: false
165           use-author: false
166           ignore-notify: false
167           wipe-workspace: '{wipe_workspace}'
168           prune: false
169           clean:
170             after: false
171             before: '{clean_before}'
172           choosing-strategy: 'default'
173
174 - scm:
175     name: git-scm-gerrit
176     scm:
177       - git:
178           url: '$GIT_BASE_SSH/$PROJECT'
179           credentials-id: '{ssh-credentials-id}'
180           branches:
181             - 'refs/heads/{branch}'
182           refspec: '{refspec}'
183           timeout: 15
184           per-build-tag: false
185           skip-tag: true
186           shallow-clone: false
187           use-author: false
188           ignore-notify: false
189           wipe-workspace: '{wipe_workspace}'
190           prune: false
191           clean:
192             after: false
193             before: '{clean_before}'
194           choosing-strategy: 'gerrit'
195
196 - scm:
197     name: git-scm-github
198     scm:
199       - git:
200           url: 'https://github.com/$PROJECT.git'
201           branches:
202             - '*/{branch}'
203           refspec: '{refspec}'
204           timeout: 15
205           per-build-tag: false
206           skip-tag: true
207           shallow-clone: false
208           use-author: false
209           ignore-notify: false
210           wipe-workspace: '{wipe_workspace}'
211           prune: false
212           clean:
213             after: false
214             before: '{clean_before}'
215           choosing-strategy: 'default'
216           basedir: '{base_dir}'
217
218 # triggers for Nordix Gerrit
219 - trigger:
220     name: nordix-gerrit-trigger-patchset-created
221     triggers:
222       - gerrit:
223           server-name: 'Nordix Gerrit'
224           trigger-on:
225             - patchset-created-event:
226                 exclude-drafts: 'false'
227                 exclude-trivial-rebase: 'false'
228                 exclude-no-code-change: 'false'
229             - draft-published-event
230             - comment-added-contains-event:
231                 comment-contains-value: 'recheck'
232             - comment-added-contains-event:
233                 comment-contains-value: 'reverify'
234           projects:
235             - project-compare-type: 'REG_EXP'
236               project-pattern: '{project}'
237               branches:
238                 - branch-compare-type: 'ANT'
239                   branch-pattern: '**/{branch}'
240               file-paths:
241                 - compare-type: 'ANT'
242                   pattern: '{files}'
243           skip-vote:
244             successful: false
245             failed: false
246             unstable: false
247             notbuilt: false
248
249 - trigger:
250     name: nordix-gerrit-trigger-change-merged
251     triggers:
252       - gerrit:
253           server-name: 'Nordix Gerrit'
254           trigger-on:
255             - change-merged-event
256             - comment-added-contains-event:
257                 comment-contains-value: 'remerge'
258           projects:
259             - project-compare-type: 'ANT'
260               project-pattern: '{project}'
261               branches:
262                 - branch-compare-type: 'ANT'
263                   branch-pattern: '**/{branch}'
264               file-paths:
265                 - compare-type: 'ANT'
266                   pattern: '{files}'
267
268 - trigger:
269     name: nordix-gerrit-push-upstream
270     triggers:
271       - gerrit:
272           server-name: 'Nordix Gerrit'
273           trigger-on:
274             - comment-added-contains-event:
275                 comment-contains-value: 'push-upstream'
276           projects:
277             - project-compare-type: 'ANT'
278               project-pattern: '{project}'
279               branches:
280                 - branch-compare-type: 'ANT'
281                   branch-pattern: '**/{branch}'
282               file-paths:
283                 - compare-type: 'ANT'
284                   pattern: '{files}'
285
286 - trigger:
287     name: nordix-gerrit-patchset-created-or-push-upstream
288     triggers:
289       - gerrit:
290           server-name: 'Nordix Gerrit'
291           trigger-on:
292             - comment-added-contains-event:
293                 comment-contains-value: 'push-upstream'
294             - patchset-created-event:
295                 exclude-drafts: true
296           projects:
297             - project-compare-type: 'ANT'
298               project-pattern: '{project}'
299               branches:
300                 - branch-compare-type: 'ANT'
301                   branch-pattern: '**/{branch}'
302               file-paths:
303                 - compare-type: 'ANT'
304                   pattern: '{files}'
305
306 # triggers for ONAP Gerrit
307 - trigger:
308     name: onap-gerrit-trigger-change-merged
309     triggers:
310       - gerrit:
311           server-name: 'ONAP Gerrit'
312           trigger-on:
313             - change-merged-event
314             - comment-added-contains-event:
315                 comment-contains-value: 'remerge'
316           projects:
317             - project-compare-type: 'ANT'
318               project-pattern: '{project}'
319               branches:
320                 - branch-compare-type: 'ANT'
321                   branch-pattern: '**/{branch}'
322               file-paths:
323                 - compare-type: 'ANT'
324                   pattern: '{files}'
325           silent: true
326           silent-start: true
327
328 # triggers for Acumos Gerrit
329 - trigger:
330     name: acumos-gerrit-trigger-change-merged
331     triggers:
332       - gerrit:
333           server-name: 'Acumos Gerrit'
334           trigger-on:
335             - change-merged-event
336             - comment-added-contains-event:
337                 comment-contains-value: 'remerge'
338           projects:
339             - project-compare-type: 'ANT'
340               project-pattern: '{project}'
341               branches:
342                 - branch-compare-type: 'ANT'
343                   branch-pattern: '**/{branch}'
344               file-paths:
345                 - compare-type: 'ANT'
346                   pattern: '{files}'
347           silent: true
348           silent-start: true
349
350 # triggers for ODL Gerrit
351 - trigger:
352     name: odl-gerrit-trigger-change-merged
353     triggers:
354       - gerrit:
355           server-name: 'ODL Gerrit'
356           trigger-on:
357             - change-merged-event
358             - comment-added-contains-event:
359                 comment-contains-value: 'remerge'
360           projects:
361             - project-compare-type: 'ANT'
362               project-pattern: '{project}'
363               branches:
364                 - branch-compare-type: 'ANT'
365                   branch-pattern: '**/{branch}'
366               file-paths:
367                 - compare-type: 'ANT'
368                   pattern: '{files}'
369           silent: true
370           silent-start: true
371
372 # triggers for OpenDev Gerrit
373 - trigger:
374     name: opendev-gerrit-trigger-change-merged
375     triggers:
376       - gerrit:
377           server-name: 'OpenDev Gerrit'
378           trigger-on:
379             - change-merged-event
380             - comment-added-contains-event:
381                 comment-contains-value: 'remerge'
382           projects:
383             - project-compare-type: 'ANT'
384               project-pattern: '{project}'
385               branches:
386                 - branch-compare-type: 'ANT'
387                   branch-pattern: '**/{branch}'
388               file-paths:
389                 - compare-type: 'ANT'
390                   pattern: '{files}'
391           silent: true
392           silent-start: true
393
394 # triggers for ORANSC Gerrit
395 - trigger:
396     name: oransc-gerrit-trigger-change-merged
397     triggers:
398       - gerrit:
399           server-name: 'ORANSC Gerrit'
400           trigger-on:
401             - change-merged-event
402             - comment-added-contains-event:
403                 comment-contains-value: 'remerge'
404           projects:
405             - project-compare-type: 'ANT'
406               project-pattern: '{project}'
407               branches:
408                 - branch-compare-type: 'ANT'
409                   branch-pattern: '**/{branch}'
410               file-paths:
411                 - compare-type: 'ANT'
412                   pattern: '{files}'
413           silent: true
414           silent-start: true
415
416 # triggers for Fast Data Project Gerrit
417 - trigger:
418     name: fdio-gerrit-trigger-change-merged
419     triggers:
420       - gerrit:
421           server-name: 'FDio Gerrit'
422           trigger-on:
423             - change-merged-event
424             - comment-added-contains-event:
425                 comment-contains-value: 'remerge'
426           projects:
427             - project-compare-type: 'ANT'
428               project-pattern: '{project}'
429               branches:
430                 - branch-compare-type: 'ANT'
431                   branch-pattern: '**/{branch}'
432               file-paths:
433                 - compare-type: 'ANT'
434                   pattern: '{files}'
435           silent: true
436           silent-start: true
437
438 # wrappers to use for jobs
439 - wrapper:
440     name: nordixinfra-jjb-creds-wrapper
441     wrappers:
442       - credentials-binding:
443           - username-password-separated:
444               credential-id: nordixinfra-jjb-creds
445               username: JJB_USERNAME
446               password: JJB_USERTOKEN
447
448 # wrappers to use for jobs
449 - wrapper:
450     name: nordixinfra-harbor-creds-wrapper
451     wrappers:
452       - credentials-binding:
453           - username-password-separated:
454               credential-id: nordix-cicd-harbor-credentials
455               username: HARBOR_USERNAME
456               password: HARBOR_PASSWORD
457
458 # wrappers to use for jobs
459 - wrapper:
460     name: nordixinfra-eiffel-github-token
461     wrappers:
462       - credentials-binding:
463           - username-password-separated:
464               credential-id: nordixinfra-eiffel-username-personal-access-token
465               username: NORDIXINFRA_GITHUB_USERNAME
466               password: NORDIXINFRA_GITHUB_TOKEN
467
468 # wrappers to use for jobs
469 - wrapper:
470     name: nordix-gerrit-http-api-token
471     wrappers:
472       - credentials-binding:
473           - username-password-separated:
474               credential-id: nordixinfra-nordix-gerrit-http-api-token
475               username: GERRIT_USER
476               password: GERRIT_API_KEY
477
478 # timeout wrapper to use for jobs
479 - wrapper:
480     name: build-timeout
481     wrappers:
482       - timeout:
483           timeout: '{timeout}'
484           timeout-var: 'BUILD_TIMEOUT'
485           fail: true
486
487 # wrapper to fix jenkins build workspace permissions
488 - wrapper:
489     name: fix-workspace-permissions
490     wrappers:
491       - pre-scm-buildstep:
492           failOnError: true
493           buildsteps:
494             - shell: |
495                 #!/bin/bash
496                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
497
498 - publisher:
499     name: notify-slack
500     publishers:
501       - slack:
502           room: '{slack-channel}'
503           notify-start: '{notify-start}'
504           notify-success: '{notify-success}'
505           notify-failure: '{notify-failure}'
506           notify-back-to-normal: '{notify-back-to-normal}'
507
508 # property to discard old builds
509 - property:
510     name: logrotate
511     properties:
512       - build-discarder:
513           days-to-keep: 30
514           num-to-keep: 100
515           artifact-days-to-keep: 30
516           artifact-num-to-keep: 100
517
518 - property:
519     name: est-ms-teams-rebase-jobs-webhook
520     properties:
521       - office-365-connector:
522             webhooks:
523               - url: "${EST_MS_TEAMS_NORDIX_REBASE_JOBS_WEBHOOK}"
524                 name: full
525                 start-notification: true
526                 notify-success: true
527                 notify-aborted: true
528                 notify-not-built: true
529                 notify-unstable: true
530                 notify-failure: true
531                 notify-back-to-normal: true
532                 notify-repeated-failure: true