Add jenkins_jobs.ini
[infra/cicd.git] / jjb / global / jjb-macros.yaml
1 ---
2 # these parameters are used for infra related variables
3 - parameter:
4     name: infra-parameter
5     parameters:
6       - string:
7           name: JJB_GIT_REPO
8           default: https://git.openstack.org/openstack-infra/jenkins-job-builder
9           description: OpenStack JJB repo
10       - string:
11           name: JJB_VERSION
12           default: 2.2.1
13           description: OpenStack JJB version to install - matches to LFN JJB version
14
15 # these parameters are used for setting the Gerrit Project on Nordix
16 - parameter:
17     name: project-parameter
18     parameters:
19       - string:
20           name: PROJECT
21           default: '{project}'
22           description: JJB configured PROJECT parameter to identify a Nordix Gerrit project
23
24 # these parameters are used for streaming changes from various Gerrit Systems
25 - parameter:
26     name: nordix-gerrit-parameters
27     parameters:
28       - string:
29           name: GERRIT_USER
30           default: infra
31           description: Non-interactive user to stream Gerrit Events on Nordix Gerrit
32       - string:
33           name: GIT_BASE_HTTPS
34           default: https://gerrit.nordix.org/
35           description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo
36       - string:
37           name: GIT_BASE_SSH
38           default: ssh://$GERRIT_USER@gerrit.nordix.org:29418/
39           description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo
40
41 - parameter:
42     name: onap-gerrit-parameters
43     parameters:
44       - string:
45           name: GERRIT_USER
46           default: nordix
47           description: Non-interactive user to stream Gerrit Events on ONAP Gerrit
48       - string:
49           name: GIT_BASE_HTTPS
50           default: https://gerrit.onap.org/r/p/
51           description: HTTPS URL to Project Repo on ONAP Gerrit to clone repo
52       - string:
53           name: GIT_BASE_SSH
54           default: ssh://$GERRIT_USER@gerrit.onap.org:29418/
55           description: SSH URL to Project Repo on ONAP Gerrit to clone repo
56
57 # defaults for job build history
58 - property:
59     name: logrotate-default
60     properties:
61       - build-discarder:
62           days-to-keep: 60
63           num-to-keep: 200
64           artifact-days-to-keep: 60
65           artifact-num-to-keep: 200
66
67 # defaults for SCM and Gerrit
68 - scm:
69     name: git-scm
70     scm:
71       - git: &git-scm-defaults
72           url: '$GIT_BASE_HTTPS'
73           branches:
74             - 'origin/$BRANCH'
75           timeout: 15
76           per-build-tag: false
77           skip-tag: true
78           shallow-clone: false
79           use-author: false
80           ignore-notify: false
81           wipe-workspace: true
82           prune: false
83
84 - scm:
85     name: git-scm-gerrit
86     scm:
87       - git:
88           choosing-strategy: 'gerrit'
89           refspec: '$GERRIT_REFSPEC'
90           <<: *git-scm-defaults
91
92 # triggers for Nordix and upstream Gerrits
93 - trigger:
94     name: nordix-gerrit-trigger-patchset-created
95     triggers:
96       - gerrit:
97           server-name: 'Nordix Gerrit'
98           trigger-on:
99             - patchset-created-event:
100                 exclude-drafts: 'false'
101                 exclude-trivial-rebase: 'false'
102                 exclude-no-code-change: 'false'
103             - draft-published-event
104             - comment-added-contains-event:
105                 comment-contains-value: 'recheck'
106             - comment-added-contains-event:
107                 comment-contains-value: 'reverify'
108           projects:
109             - project-compare-type: 'ANT'
110               project-pattern: '{project}'
111               branches:
112                 - branch-compare-type: 'ANT'
113                   branch-pattern: '**/{branch}'
114               file-paths:
115                 - compare-type: 'ANT'
116                   pattern: '{files}'
117           skip-vote:
118             successful: false
119             failed: false
120             unstable: false
121             notbuilt: false
122
123 - trigger:
124     name: nordix-gerrit-trigger-change-merged
125     triggers:
126       - gerrit:
127           server-name: 'Nordix Gerrit'
128           trigger-on:
129             - change-merged-event
130             - comment-added-contains-event:
131                 comment-contains-value: 'remerge'
132           projects:
133             - project-compare-type: 'ANT'
134               project-pattern: '{project}'
135               branches:
136                 - branch-compare-type: 'ANT'
137                   branch-pattern: '**/{branch}'
138               file-paths:
139                 - compare-type: 'ANT'
140                   pattern: '{files}'