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