324b09c3260f9c52035a672eda21780215e7e3f1
[releng.git] / docs / jenkins-job-builder / 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 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.
36
37 You can add below persons as reviewers to your patch in order to get it reviewed and submitted.
38
39 * Ulrich Kleber (Ulrich.Kleber@huawei.com)
40 * Fatih Degirmenci (fatih.degirmenci@ericsson.com)
41 * Xinyu Zhao(Jerry) (zhaoxinyu@huawei.com)
42
43 Or just email a request for submission to opnfv-helpdesk@rt.linuxfoundation.org
44
45 The Current merge and verify jobs for jenkins job builder as pulled from the repo::
46
47
48 **releng-jobs.yaml**:
49
50 .. code-block:: bash
51
52  - project:
53      name: builder-jobs
54      jobs:
55          - 'builder-verify-jjb'
56          - 'builder-merge'
57  
58      project: 'releng'
59  
60  - job-template:
61      name: builder-verify-jjb
62  
63      node: master
64  
65      project-type: freestyle
66  
67      logrotate:
68          daysToKeep: 30
69          numToKeep: 10
70          artifactDaysToKeep: -1
71          artifactNumToKeep: -1
72  
73      parameters:
74          - project-parameter:
75              project: '{project}'
76          - gerrit-parameter:
77              branch: 'master'
78      scm:
79          - gerrit-trigger-scm:
80              credentials-id: '{ssh-credentials}'
81              refspec: '$GERRIT_REFSPEC'
82              choosing-strategy: 'gerrit'
83  
84      wrappers:
85          - ssh-agent-credentials:
86              user: '{ssh-credentials}'
87  
88      triggers:
89          - gerrit:
90              trigger-on:
91                  - patchset-created-event:
92                      exclude-drafts: 'false'
93                      exclude-trivial-rebase: 'false'
94                      exclude-no-code-change: 'false'
95                  - draft-published-event
96                  - comment-added-contains-event:
97                      comment-contains-value: 'recheck'
98                  - comment-added-contains-event:
99                      comment-contains-value: 'reverify'
100              projects:
101                - project-compare-type: 'ANT'
102                  project-pattern: 'releng'
103                  branches:
104                    - branch-compare-type: 'ANT'
105                      branch-pattern: '**/master'
106                  file-paths:
107                      - compare-type: ANT
108                        pattern: jjb/**
109                      - compare-type: ANT
110                        pattern: jjb-templates/**
111  
112  
113      builders:
114          - shell:
115              !include-raw verify-releng
116  
117  - job-template:
118      name: 'builder-merge'
119  
120      node: master
121  
122      # builder-merge job to run JJB update
123      #
124      # This job's purpose is to update all the JJB
125  
126      project-type: freestyle
127  
128      logrotate:
129          daysToKeep: 30
130          numToKeep: 40
131          artifactDaysToKeep: -1
132          artifactNumToKeep: 5
133  
134      parameters:
135          - project-parameter:
136              project: '{project}'
137          - gerrit-parameter:
138              branch: 'master'
139  
140      scm:
141          - gerrit-trigger-scm:
142              credentials-id: '{ssh-credentials}'
143              refspec: ''
144              choosing-strategy: 'default'
145  
146      wrappers:
147          - ssh-agent-credentials:
148              user: '{ssh-credentials}'
149  
150      triggers:
151          - gerrit:
152              trigger-on:
153                  - change-merged-event
154                  - comment-added-contains-event:
155                      comment-contains-value: 'remerge'
156              projects:
157                - project-compare-type: 'ANT'
158                  project-pattern: 'releng'
159                  branches:
160                      - branch-compare-type: 'ANT'
161                        branch-pattern: '**/master'
162                  file-paths:
163                      - compare-type: ANT
164                        pattern: jjb/**
165  
166      builders:
167          - shell: |
168                  source /opt/virtualenv/jenkins-job-builder/bin/activate
169                  cd /opt/jenkins-ci/releng
170                  git pull
171                  jenkins-jobs update --delete-old jjb/
172  
173  
174
175
176 Revision: _sha1_
177
178 Build date:  _date_