Fix Line Length etc for existing docs
[opnfvdocs.git] / docs / arno / opnfv-jjb-usage.rst
1 Creating/Configuring/Verifying Jenkins Jobs
2 ============================================
3
4 Clone the repo::
5
6  git clone ssh://YOU@gerrit.opnfv.org:29418/releng
7
8 make changes::
9
10  git commit -sv
11  git review
12  remote: Resolving deltas: 100% (3/3)
13  remote: Processing changes: new: 1, refs: 1, done
14  remote:
15  remote: New Changes:
16  remote:   https://gerrit.opnfv.org/gerrit/51
17  remote:
18  To ssh://agardner@gerrit.opnfv.org:29418/releng.git
19   * [new branch]      HEAD -> refs/publish/master
20
21 Follow the link to gerrit https://gerrit.opnfv.org/gerrit/51 in a few moments the verify job will have completed and you will see Verified +1 jenkins-ci in the gerrit ui.
22
23 If the changes pass the verify job https://build.opnfv.org/ci/view/builder/job/builder-verify-jjb/ The patch can be submitited by a committer.
24
25 Job Types
26
27 * Verify Job
28
29  * Trigger: **recheck** or **reverify**
30
31 * Merge Job
32
33  * Trigger: **remerge**
34
35 The verify and merge jobs are retriggerable in Gerrit by simply leaving a comment
36 with one of the keywords listed above.
37 This is useful in case you need to re-run one of those jobs in case if build issues or
38 something changed with the environment.
39
40 You can add below persons as reviewers to your patch in order to get it reviewed and submitted.
41
42 * Ulrich Kleber (Ulrich.Kleber@huawei.com)
43 * Fatih Degirmenci (fatih.degirmenci@ericsson.com)
44 * Xinyu Zhao(Jerry) (zhaoxinyu@huawei.com)
45
46 Or just email a request for submission to opnfv-helpdesk@rt.linuxfoundation.org
47
48 The Current merge and verify jobs for jenkins job builder as pulled from the repo::
49
50  - project:
51     name: builder-jobs
52     jobs:
53         - 'builder-verify-jjb'
54         - 'builder-merge'
55
56     project: 'releng'
57
58  - job-template:
59     name: builder-verify-jjb
60
61     project-type: freestyle
62
63     logrotate:
64         daysToKeep: 30
65         numToKeep: 10
66         artifactDaysToKeep: -1
67         artifactNumToKeep: -1
68
69     parameters:
70         - project-parameter:
71             project: '{project}'
72         - gerrit-parameter:
73             branch: 'master'
74     scm:
75         - gerrit-trigger-scm:
76             credentials-id: '{ssh-credentials}'
77             refspec: '$GERRIT_REFSPEC'
78             choosing-strategy: 'gerrit'
79
80     wrappers:
81         - ssh-agent-credentials:
82             user: '{ssh-credentials}'
83
84     triggers:
85         - gerrit:
86             trigger-on:
87                 - patchset-created-event:
88                     exclude-drafts: 'false'
89                     exclude-trivial-rebase: 'false'
90                     exclude-no-code-change: 'false'
91                 - draft-published-event
92                 - comment-added-contains-event:
93                     comment-contains-value: 'recheck'
94                 - comment-added-contains-event:
95                     comment-contains-value: 'reverify'
96             projects:
97               - project-compare-type: 'ANT'
98                 project-pattern: 'releng'
99                 branches:
100                   - branch-compare-type: 'ANT'
101                     branch-pattern: '**/master'
102                 file-paths:
103                     - compare-type: ANT
104                       pattern: jjb/**
105                     - compare-type: ANT
106                       pattern: jjb-templates/**
107
108
109     builders:
110         - shell: |
111             source /opt/virtualenv/jenkins-job-builder/bin/activate
112             jenkins-jobs test /opt/jenkins-ci/builder/
113
114  - job-template:
115     name: 'builder-merge'
116
117     # builder-merge job to run JJB update
118     #
119     # This job's purpose is to update all the JJB
120
121     project-type: freestyle
122
123     logrotate:
124         daysToKeep: 30
125         numToKeep: 40
126         artifactDaysToKeep: -1
127         artifactNumToKeep: 5
128
129     parameters:
130         - project-parameter:
131             project: '{project}'
132         - gerrit-parameter:
133             branch: 'master'
134
135     scm:
136         - gerrit-trigger-scm:
137             credentials-id: '{ssh-credentials}'
138             refspec: ''
139             choosing-strategy: 'default'
140
141     wrappers:
142         - ssh-agent-credentials:
143             user: '{ssh-credentials}'
144
145     triggers:
146         - gerrit:
147             trigger-on:
148                 - change-merged-event
149                 - comment-added-contains-event:
150                     comment-contains-value: 'remerge'
151             projects:
152               - project-compare-type: 'ANT'
153                 project-pattern: 'releng'
154                 branches:
155                     - branch-compare-type: 'ANT'
156                       branch-pattern: '**/master'
157                 file-paths:
158                     - compare-type: ANT
159                       pattern: jjb/**
160
161     builders:
162         - shell: |
163                 source /opt/virtualenv/jenkins-job-builder/bin/activate
164                 cd /opt/jenkins-ci/releng
165                 git pull
166                 jenkins-jobs update --delete-old jjb/
167
168
169
170 **Documentation tracking**
171
172 Revision: _sha1_
173
174 Build date:  _date_