Add jjb credentials to infra-jjb-verify
[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: &git-scm-defaults
76           url: '$GIT_BASE_HTTPS/$PROJECT'
77           branches:
78             - 'origin/$BRANCH'
79           timeout: 15
80           per-build-tag: false
81           skip-tag: true
82           shallow-clone: false
83           use-author: false
84           ignore-notify: false
85           wipe-workspace: true
86           prune: false
87
88 - scm:
89     name: git-scm-gerrit
90     scm:
91       - git:
92           choosing-strategy: 'gerrit'
93           refspec: '$GERRIT_REFSPEC'
94           <<: *git-scm-defaults
95
96 # triggers for Nordix and upstream Gerrits
97 - trigger:
98     name: nordix-gerrit-trigger-patchset-created
99     triggers:
100       - gerrit:
101           server-name: 'Nordix Gerrit'
102           trigger-on:
103             - patchset-created-event:
104                 exclude-drafts: 'false'
105                 exclude-trivial-rebase: 'false'
106                 exclude-no-code-change: 'false'
107             - draft-published-event
108             - comment-added-contains-event:
109                 comment-contains-value: 'recheck'
110             - comment-added-contains-event:
111                 comment-contains-value: 'reverify'
112           projects:
113             - project-compare-type: 'ANT'
114               project-pattern: '{project}'
115               branches:
116                 - branch-compare-type: 'ANT'
117                   branch-pattern: '**/{branch}'
118               file-paths:
119                 - compare-type: 'ANT'
120                   pattern: '{files}'
121           skip-vote:
122             successful: false
123             failed: false
124             unstable: false
125             notbuilt: false
126
127 - trigger:
128     name: nordix-gerrit-trigger-change-merged
129     triggers:
130       - gerrit:
131           server-name: 'Nordix Gerrit'
132           trigger-on:
133             - change-merged-event
134             - comment-added-contains-event:
135                 comment-contains-value: 'remerge'
136           projects:
137             - project-compare-type: 'ANT'
138               project-pattern: '{project}'
139               branches:
140                 - branch-compare-type: 'ANT'
141                   branch-pattern: '**/{branch}'
142               file-paths:
143                 - compare-type: 'ANT'
144                   pattern: '{files}'
145
146 # wrappers to use for jobs
147 - wrapper:
148     name: nordixinfra-jjb-creds-wrapper
149     wrappers:
150       - credentials-binding:
151           - username-password-separated:
152               credential-id: nordixinfra-jjb-creds
153               username: JJB_USERNAME
154               password: JJB_USERTOKEN