Fix git-scm configuration
[infra/cicd.git] / jjb / global / jjb-macros.yaml
1 ---
2 # these parameters are used for infra related variables
3 - parameter:
4     name: infra-parameters
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-parameters
18     parameters:
19       - string:
20           name: PROJECT
21           default: '{project}'
22           description: JJB configured PROJECT parameter to identify a Nordix Gerrit project
23       - string:
24           name: BRANCH
25           default: '{branch}'
26           description: "JJB configured BRANCH parameter (e.g. master, nordix-dev)"
27
28 # these parameters are used for streaming changes from various Gerrit Systems
29 - parameter:
30     name: nordix-gerrit-parameters
31     parameters:
32       - string:
33           name: GERRIT_USER
34           default: infra
35           description: Non-interactive user to stream Gerrit Events on Nordix Gerrit
36       - string:
37           name: GIT_BASE_HTTPS
38           default: https://gerrit.nordix.org/
39           description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo
40       - string:
41           name: GIT_BASE_SSH
42           default: ssh://$GERRIT_USER@gerrit.nordix.org:29418/
43           description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo
44
45 - parameter:
46     name: onap-gerrit-parameters
47     parameters:
48       - string:
49           name: GERRIT_USER
50           default: nordix
51           description: Non-interactive user to stream Gerrit Events on ONAP Gerrit
52       - string:
53           name: GIT_BASE_HTTPS
54           default: https://gerrit.onap.org/r/p/
55           description: HTTPS URL to Project Repo on ONAP Gerrit to clone repo
56       - string:
57           name: GIT_BASE_SSH
58           default: ssh://$GERRIT_USER@gerrit.onap.org:29418/
59           description: SSH URL to Project Repo on ONAP Gerrit to clone repo
60
61 # defaults for job build history
62 - property:
63     name: logrotate-default
64     properties:
65       - build-discarder:
66           days-to-keep: 60
67           num-to-keep: 200
68           artifact-days-to-keep: 60
69           artifact-num-to-keep: 200
70
71 # defaults for SCM and Gerrit
72 - scm:
73     name: git-scm
74     scm:
75       - git:
76           url: '$GIT_BASE_HTTPS/$PROJECT'
77           branches:
78             - 'refs/heads/{branch}'
79           refspec: '{refspec}'
80           timeout: 15
81           per-build-tag: false
82           skip-tag: true
83           shallow-clone: false
84           use-author: false
85           ignore-notify: false
86           wipe-workspace: true
87           prune: false
88           choosing-strategy: 'default'
89
90 - scm:
91     name: git-scm-gerrit
92     scm:
93       - git:
94           url: '$GIT_BASE_HTTPS/$PROJECT'
95           branches:
96             - 'refs/heads/{branch}'
97           refspec: '{refspec}'
98           timeout: 15
99           per-build-tag: false
100           skip-tag: true
101           shallow-clone: false
102           use-author: false
103           ignore-notify: false
104           wipe-workspace: true
105           prune: false
106           choosing-strategy: 'gerrit'
107
108 # triggers for Nordix and upstream Gerrits
109 - trigger:
110     name: nordix-gerrit-trigger-patchset-created
111     triggers:
112       - gerrit:
113           server-name: 'Nordix Gerrit'
114           trigger-on:
115             - patchset-created-event:
116                 exclude-drafts: 'false'
117                 exclude-trivial-rebase: 'false'
118                 exclude-no-code-change: 'false'
119             - draft-published-event
120             - comment-added-contains-event:
121                 comment-contains-value: 'recheck'
122             - comment-added-contains-event:
123                 comment-contains-value: 'reverify'
124           projects:
125             - project-compare-type: 'ANT'
126               project-pattern: '{project}'
127               branches:
128                 - branch-compare-type: 'ANT'
129                   branch-pattern: '**/{branch}'
130               file-paths:
131                 - compare-type: 'ANT'
132                   pattern: '{files}'
133           skip-vote:
134             successful: false
135             failed: false
136             unstable: false
137             notbuilt: false
138
139 - trigger:
140     name: nordix-gerrit-trigger-change-merged
141     triggers:
142       - gerrit:
143           server-name: 'Nordix Gerrit'
144           trigger-on:
145             - change-merged-event
146             - comment-added-contains-event:
147                 comment-contains-value: 'remerge'
148           projects:
149             - project-compare-type: 'ANT'
150               project-pattern: '{project}'
151               branches:
152                 - branch-compare-type: 'ANT'
153                   branch-pattern: '**/{branch}'
154               file-paths:
155                 - compare-type: 'ANT'
156                   pattern: '{files}'
157
158 # wrappers to use for jobs
159 - wrapper:
160     name: nordixinfra-jjb-creds-wrapper
161     wrappers:
162       - credentials-binding:
163           - username-password-separated:
164               credential-id: nordixinfra-jjb-creds
165               username: JJB_USERNAME
166               password: JJB_USERTOKEN