Add OPNFV Logo
[releng.git] / docs / jenkins-job-builder / opnfv-jjb-usage.rst
1 .. image:: opnfv-logo.png
2   :height: 40
3   :width: 200
4   :alt: OPNFV
5   :align: left
6
7 Creating/Configuring/Verifying Jenkins Jobs
8 ============================================
9
10 Clone the repo::
11
12  git clone ssh://YOU@gerrit.opnfv.org:29418/releng
13
14 make changes::
15
16  git commit -sv
17  git review
18  remote: Resolving deltas: 100% (3/3)
19  remote: Processing changes: new: 1, refs: 1, done
20  remote:
21  remote: New Changes:
22  remote:   https://gerrit.opnfv.org/gerrit/51
23  remote:
24  To ssh://agardner@gerrit.opnfv.org:29418/releng.git
25   * [new branch]      HEAD -> refs/publish/master
26
27 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.
28
29 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.
30
31 Job Types
32
33 * Verify Job
34
35  * Trigger: **recheck** or **reverify**
36
37 * Merge Job
38
39  * Trigger: **remerge**
40
41 The verify and merge jobs are retriggerable in Gerrit by simply leaving a comment with one of the keywords listed above. This is useful in case you need to re-run one of those jobs in case if build issues or something changed with the environment.
42
43 You can add below persons as reviewers to your patch in order to get it reviewed and submitted.
44
45 * fatih.degirmenci@ericsson.com
46 * agardner@linuxfoundation.org
47 * trozet@redhat.com
48 * morgan.richomme@orange.com
49 * vlaza@cloudbasesolutions.com
50 * matthew.lijun@huawei.com
51 * pbandzi@cisco.com
52 * jose.lausuch@ericsson.com
53 * koffirodrigue@gmail.com
54 * r-mibu@cq.jp.nec.com
55
56 Or just email a request for submission to opnfv-helpdesk@rt.linuxfoundation.org
57
58 The Current merge and verify jobs for jenkins job builder as pulled from the repo::
59
60 **releng-jobs.yaml**:
61
62 .. code-block:: bash
63
64  - project:
65      name: builder-jobs
66      jobs:
67          - 'builder-verify-jjb'
68          - 'builder-merge'
69  
70      project: 'releng'
71  
72  - job-template:
73      name: builder-verify-jjb
74  
75      node: master
76  
77      project-type: freestyle
78  
79      logrotate:
80          daysToKeep: 30
81          numToKeep: 10
82          artifactDaysToKeep: -1
83          artifactNumToKeep: -1
84  
85      parameters:
86          - project-parameter:
87              project: '{project}'
88          - gerrit-parameter:
89              branch: 'master'
90      scm:
91          - gerrit-trigger-scm:
92              credentials-id: '{ssh-credentials}'
93              refspec: '$GERRIT_REFSPEC'
94              choosing-strategy: 'gerrit'
95  
96      wrappers:
97          - ssh-agent-credentials:
98              user: '{ssh-credentials}'
99  
100      triggers:
101          - 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: 'releng'
115                  branches:
116                    - branch-compare-type: 'ANT'
117                      branch-pattern: '**/master'
118                  file-paths:
119                      - compare-type: ANT
120                        pattern: jjb/**
121                      - compare-type: ANT
122                        pattern: jjb-templates/**
123  
124  
125      builders:
126          - shell:
127              !include-raw verify-releng
128  
129  - job-template:
130      name: 'builder-merge'
131  
132      node: master
133  
134      # builder-merge job to run JJB update
135      #
136      # This job's purpose is to update all the JJB
137  
138      project-type: freestyle
139  
140      logrotate:
141          daysToKeep: 30
142          numToKeep: 40
143          artifactDaysToKeep: -1
144          artifactNumToKeep: 5
145  
146      parameters:
147          - project-parameter:
148              project: '{project}'
149          - gerrit-parameter:
150              branch: 'master'
151  
152      scm:
153          - gerrit-trigger-scm:
154              credentials-id: '{ssh-credentials}'
155              refspec: ''
156              choosing-strategy: 'default'
157  
158      wrappers:
159          - ssh-agent-credentials:
160              user: '{ssh-credentials}'
161  
162      triggers:
163          - gerrit:
164              trigger-on:
165                  - change-merged-event
166                  - comment-added-contains-event:
167                      comment-contains-value: 'remerge'
168              projects:
169                - project-compare-type: 'ANT'
170                  project-pattern: 'releng'
171                  branches:
172                      - branch-compare-type: 'ANT'
173                        branch-pattern: '**/master'
174                  file-paths:
175                      - compare-type: ANT
176                        pattern: jjb/**
177  
178      builders:
179          - shell: |
180                  source /opt/virtualenv/jenkins-job-builder/bin/activate
181                  cd /opt/jenkins-ci/releng
182                  git pull
183                  jenkins-jobs update --delete-old jjb/
184  
185  
186
187
188 Revision: _sha1_
189
190 Build date: |today|