a273c858fe4320d9de4a5eed12c662ed8a6fbe0d
[releng.git] / jjb / qtip / qtip-verify-jobs.yml
1 ######################
2 # verify before MERGE
3 ######################
4
5 - project:
6     name: qtip-verify-jobs
7     project: qtip
8     jobs:
9         - 'qtip-verify-{stream}'
10         - 'qtip-review-notebook-{stream}'
11         - 'qtip-merge-{stream}'
12     stream:
13         - master:
14             branch: '{stream}'
15             gs-pathname: ''
16             disabled: false
17         - danube:
18             branch: 'stable/{stream}'
19             gs-pathname: '/{stream}'
20             disabled: false
21
22 ################################
23 ## job templates
24 #################################
25 - job-template:
26     name: 'qtip-verify-{stream}'
27
28     disabled: '{obj:disabled}'
29
30     parameters:
31         - project-parameter:
32             project: '{project}'
33             branch: '{branch}'
34         - 'opnfv-build-ubuntu-defaults'
35
36     scm:
37         - git-scm-gerrit
38
39     triggers:
40         - gerrit:
41             server-name: 'gerrit.opnfv.org'
42             trigger-on:
43                 - patchset-created-event:
44                     exclude-drafts: 'false'
45                     exclude-trivial-rebase: 'false'
46                     exclude-no-code-change: 'false'
47                 - draft-published-event
48                 - comment-added-contains-event:
49                     comment-contains-value: 'recheck'
50                 - comment-added-contains-event:
51                     comment-contains-value: 'reverify'
52             projects:
53               - project-compare-type: 'ANT'
54                 project-pattern: '{project}'
55                 branches:
56                   - branch-compare-type: 'ANT'
57                     branch-pattern: '**/{branch}'
58                 disable-strict-forbidden-file-verification: 'true'
59                 forbidden-file-paths:
60                   - compare-type: ANT
61                     pattern: 'docs/**|.gitignore'
62
63     builders:
64         - qtip-unit-tests-and-docs-build
65     publishers:
66         - publish-coverage
67         - email-jenkins-admins-on-failure
68
69 # upload juypter notebook to artifacts for review
70 - job-template:
71     name: 'qtip-review-notebook-{stream}'
72
73     disabled: '{obj:disabled}'
74
75     parameters:
76         - project-parameter:
77             project: '{project}'
78             branch: '{branch}'
79         - 'opnfv-build-ubuntu-defaults'
80
81     scm:
82         - git-scm-gerrit
83
84     triggers:
85         - gerrit:
86             server-name: 'gerrit.opnfv.org'
87             trigger-on:
88                 - patchset-created-event:
89                     exclude-drafts: 'false'
90                     exclude-trivial-rebase: 'false'
91                     exclude-no-code-change: 'false'
92                 - draft-published-event
93                 - comment-added-contains-event:
94                     comment-contains-value: 'recheck'
95                 - comment-added-contains-event:
96                     comment-contains-value: 'reverify'
97             projects:
98               - project-compare-type: 'ANT'
99                 project-pattern: '{project}'
100                 branches:
101                   - branch-compare-type: 'ANT'
102                     branch-pattern: '**/{branch}'
103                 disable-strict-forbidden-file-verification: 'true'
104                 file-paths:
105                   - compare-type: ANT
106                     pattern: 'examples/**'
107     builders:
108         - upload-under-review-notebooks-to-opnfv-artifacts
109         - report-build-result-to-gerrit
110
111 - job-template:
112     name: 'qtip-merge-{stream}'
113
114     disabled: '{obj:disabled}'
115
116     parameters:
117         - project-parameter:
118             project: $GERRIT_PROJECT
119             branch: '{branch}'
120         - string:
121             name: GS_URL
122             default: '$GS_BASE{gs-pathname}'
123             description: "Directory where the build artifact will be located upon the completion of the build."
124         - string:
125             name: GERRIT_REFSPEC
126             default: 'refs/heads/{branch}'
127             description: "JJB configured GERRIT_REFSPEC parameter"
128
129     scm:
130         - git-scm
131
132     triggers:
133         - gerrit:
134             server-name: 'gerrit.opnfv.org'
135             trigger-on:
136                 - change-merged-event
137                 - comment-added-contains-event:
138                     comment-contains-value: 'remerge'
139             projects:
140                 - project-compare-type: 'ANT'
141                   project-pattern: '*'
142                   branches:
143                       - branch-compare-type: 'ANT'
144                         branch-pattern: '**/{branch}'
145                   file-paths:
146                       - compare-type: ANT
147                         pattern: examples/**
148
149     builders:
150         - remove-old-docs-from-opnfv-artifacts
151
152 ################################
153 ## job builders
154 #################################
155 - builder:
156     name: qtip-unit-tests-and-docs-build
157     builders:
158         - shell: |
159             #!/bin/bash
160             set -o errexit
161             set -o pipefail
162             set -o xtrace
163
164             tox
165
166 # modified from upload-under-review-docs-to-opnfv-artifacts in global/releng-macro.yml
167 - builder:
168     name: upload-under-review-notebooks-to-opnfv-artifacts
169     builders:
170         - shell: |
171             #!/bin/bash
172             set -o errexit
173             set -o pipefail
174             set -o xtrace
175             export PATH=$PATH:/usr/local/bin/
176
177             [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
178             [[ -d examples ]] || exit 0
179
180             echo
181             echo "###########################"
182             echo "UPLOADING DOCS UNDER REVIEW"
183             echo "###########################"
184             echo
185
186             gs_base="artifacts.opnfv.org/$PROJECT/review"
187             gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
188             local_path="upload/$GERRIT_CHANGE_NUMBER"
189
190             mkdir -p upload
191             cp -r examples "$local_path"
192             gsutil -m cp -r "$local_path" "gs://$gs_base/"
193
194             echo "Document link(s):" >> gerrit_comment.txt
195             find "$local_path" | grep -e 'ipynb$' | \
196                 sed -e "s|^$local_path|    https://nbviewer.jupyter.org/url/$gs_path|" >> gerrit_comment.txt