Merge "link from releng jjb to daily JOID job ORCHESTRA-15 ORCHESTRA-16"
[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
68 # upload juypter notebook to artifacts for review
69 - job-template:
70     name: 'qtip-review-notebook-{stream}'
71
72     disabled: '{obj:disabled}'
73
74     parameters:
75         - project-parameter:
76             project: '{project}'
77             branch: '{branch}'
78         - 'opnfv-build-ubuntu-defaults'
79
80     scm:
81         - git-scm-gerrit
82
83     triggers:
84         - gerrit:
85             server-name: 'gerrit.opnfv.org'
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: '{project}'
99                 branches:
100                   - branch-compare-type: 'ANT'
101                     branch-pattern: '**/{branch}'
102                 disable-strict-forbidden-file-verification: 'true'
103                 file-paths:
104                   - compare-type: ANT
105                     pattern: 'examples/**'
106     builders:
107         - upload-under-review-notebooks-to-opnfv-artifacts
108         - report-build-result-to-gerrit
109
110 - job-template:
111     name: 'qtip-merge-{stream}'
112
113     disabled: '{obj:disabled}'
114
115     parameters:
116         - project-parameter:
117             project: $GERRIT_PROJECT
118             branch: '{branch}'
119         - string:
120             name: GS_URL
121             default: '$GS_BASE{gs-pathname}'
122             description: "Directory where the build artifact will be located upon the completion of the build."
123         - string:
124             name: GERRIT_REFSPEC
125             default: 'refs/heads/{branch}'
126             description: "JJB configured GERRIT_REFSPEC parameter"
127
128     scm:
129         - git-scm
130
131     triggers:
132         - gerrit:
133             server-name: 'gerrit.opnfv.org'
134             trigger-on:
135                 - change-merged-event
136                 - comment-added-contains-event:
137                     comment-contains-value: 'remerge'
138             projects:
139                 - project-compare-type: 'ANT'
140                   project-pattern: '*'
141                   branches:
142                       - branch-compare-type: 'ANT'
143                         branch-pattern: '**/{branch}'
144                   file-paths:
145                       - compare-type: ANT
146                         pattern: examples/**
147
148     builders:
149         - remove-old-docs-from-opnfv-artifacts
150
151 ################################
152 ## job builders
153 #################################
154 - builder:
155     name: qtip-unit-tests-and-docs-build
156     builders:
157         - shell: |
158             #!/bin/bash
159             set -o errexit
160             set -o pipefail
161             set -o xtrace
162
163             tox
164
165 # modified from upload-under-review-docs-to-opnfv-artifacts in global/releng-macro.yml
166 - builder:
167     name: upload-under-review-notebooks-to-opnfv-artifacts
168     builders:
169         - shell: |
170             #!/bin/bash
171             set -o errexit
172             set -o pipefail
173             set -o xtrace
174             export PATH=$PATH:/usr/local/bin/
175
176             [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
177             [[ -d examples ]] || exit 0
178
179             echo
180             echo "###########################"
181             echo "UPLOADING DOCS UNDER REVIEW"
182             echo "###########################"
183             echo
184
185             gs_base="artifacts.opnfv.org/$PROJECT/review"
186             gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
187             local_path="upload/$GERRIT_CHANGE_NUMBER"
188
189             mkdir -p upload
190             cp -r examples "$local_path"
191             gsutil -m cp -r "$local_path" "gs://$gs_base/"
192
193             echo "Document link(s):" >> gerrit_comment.txt
194             find "$local_path" | grep -e 'ipynb$' | \
195                 sed -e "s|^$local_path|    https://nbviewer.jupyter.org/url/$gs_path|" >> gerrit_comment.txt