Switch to ssh for git scm
[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       - string:
45           name: CREDENTIALS_ID
46           default: nordixinfra-nordix-gerrit-ssh
47           description: Nordix Infra SSH credentials for Nordix Gerrit
48
49 - parameter:
50     name: onap-gerrit-parameters
51     parameters:
52       - string:
53           name: GERRIT_USER
54           default: nordix
55           description: Non-interactive user to stream Gerrit Events on ONAP Gerrit
56       - string:
57           name: GIT_BASE_HTTPS
58           default: https://gerrit.onap.org/r/p
59           description: HTTPS URL to Project Repo on ONAP Gerrit to clone repo
60       - string:
61           name: GIT_BASE_SSH
62           default: ssh://$GERRIT_USER@gerrit.onap.org:29418
63           description: SSH URL to Project Repo on ONAP Gerrit to clone repo
64       - string:
65           name: CREDENTIALS_ID
66           default: nordixinfra-lfn-gerrit-ssh
67           description: Nordix Infra SSH credentials for LFN Gerrit
68
69 # defaults for job build history
70 - property:
71     name: logrotate-default
72     properties:
73       - build-discarder:
74           days-to-keep: 60
75           num-to-keep: 200
76           artifact-days-to-keep: 60
77           artifact-num-to-keep: 200
78
79 # defaults for SCM and Gerrit
80 - scm:
81     name: git-scm
82     scm:
83       - git:
84           url: '$GIT_BASE_SSH/$PROJECT'
85           credentials-id: '$CREDENTIALS_ID'
86           branches:
87             - 'refs/heads/{branch}'
88           refspec: '{refspec}'
89           timeout: 15
90           per-build-tag: false
91           skip-tag: true
92           shallow-clone: false
93           use-author: false
94           ignore-notify: false
95           wipe-workspace: true
96           prune: false
97           choosing-strategy: 'default'
98
99 - scm:
100     name: git-scm-gerrit
101     scm:
102       - git:
103           url: '$GIT_BASE_SSH/$PROJECT'
104           credentials-id: '$CREDENTIALS_ID'
105           branches:
106             - 'refs/heads/{branch}'
107           refspec: '{refspec}'
108           timeout: 15
109           per-build-tag: false
110           skip-tag: true
111           shallow-clone: false
112           use-author: false
113           ignore-notify: false
114           wipe-workspace: true
115           prune: false
116           choosing-strategy: 'gerrit'
117
118 # triggers for Nordix and upstream Gerrits
119 - trigger:
120     name: nordix-gerrit-trigger-patchset-created
121     triggers:
122       - gerrit:
123           server-name: 'Nordix Gerrit'
124           trigger-on:
125             - patchset-created-event:
126                 exclude-drafts: 'false'
127                 exclude-trivial-rebase: 'false'
128                 exclude-no-code-change: 'false'
129             - draft-published-event
130             - comment-added-contains-event:
131                 comment-contains-value: 'recheck'
132             - comment-added-contains-event:
133                 comment-contains-value: 'reverify'
134           projects:
135             - project-compare-type: 'ANT'
136               project-pattern: '{project}'
137               branches:
138                 - branch-compare-type: 'ANT'
139                   branch-pattern: '**/{branch}'
140               file-paths:
141                 - compare-type: 'ANT'
142                   pattern: '{files}'
143           skip-vote:
144             successful: false
145             failed: false
146             unstable: false
147             notbuilt: false
148
149 - trigger:
150     name: nordix-gerrit-trigger-change-merged
151     triggers:
152       - gerrit:
153           server-name: 'Nordix Gerrit'
154           trigger-on:
155             - change-merged-event
156             - comment-added-contains-event:
157                 comment-contains-value: 'remerge'
158           projects:
159             - project-compare-type: 'ANT'
160               project-pattern: '{project}'
161               branches:
162                 - branch-compare-type: 'ANT'
163                   branch-pattern: '**/{branch}'
164               file-paths:
165                 - compare-type: 'ANT'
166                   pattern: '{files}'
167
168 # wrappers to use for jobs
169 - wrapper:
170     name: nordixinfra-jjb-creds-wrapper
171     wrappers:
172       - credentials-binding:
173           - username-password-separated:
174               credential-id: nordixinfra-jjb-creds
175               username: JJB_USERNAME
176               password: JJB_USERTOKEN