Merge "Create Stable Branch Jobs for clover"
[releng.git] / jjb / qtip / qtip-verify-jobs.yaml
1 ---
2 ######################
3 # verify before MERGE
4 ######################
5
6 - project:
7     name: qtip-verify-jobs
8     project: qtip
9     jobs:
10       - 'qtip-verify-{stream}'
11     stream:
12       - master:
13           branch: '{stream}'
14           gs-pathname: ''
15           disabled: false
16       - fraser:
17           branch: 'stable/{stream}'
18           gs-pathname: '/{stream}'
19           disabled: false
20
21 ################################
22 ## job templates
23 #################################
24 - job-template:
25     name: 'qtip-verify-{stream}'
26
27     disabled: '{obj:disabled}'
28
29     parameters:
30       - project-parameter:
31           project: '{project}'
32           branch: '{branch}'
33       - 'opnfv-build-ubuntu-defaults'
34
35     scm:
36       - git-scm-gerrit
37
38     triggers:
39       - gerrit:
40           server-name: 'gerrit.opnfv.org'
41           trigger-on:
42             - patchset-created-event:
43                 exclude-drafts: 'false'
44                 exclude-trivial-rebase: 'false'
45                 exclude-no-code-change: 'false'
46             - draft-published-event
47             - comment-added-contains-event:
48                 comment-contains-value: 'recheck'
49             - comment-added-contains-event:
50                 comment-contains-value: 'reverify'
51           projects:
52             - project-compare-type: 'ANT'
53               project-pattern: '{project}'
54               branches:
55                 - branch-compare-type: 'ANT'
56                   branch-pattern: '**/{branch}'
57               disable-strict-forbidden-file-verification: 'true'
58               forbidden-file-paths:
59                 - compare-type: ANT
60                   pattern: 'docs/**|.gitignore'
61
62     builders:
63       - qtip-unit-tests-and-docs-build
64     publishers:
65       - publish-coverage
66       - email-jenkins-admins-on-failure
67
68 # Upload juypter notebook to artifacts for review
69 # TODO(yujunz): deal with *.ipynb deletion
70 - job-template:
71     name: 'qtip-verify-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: '**/*.ipynb'
107
108     builders:
109       - upload-under-review-notebooks-to-opnfv-artifacts
110       - report-build-result-to-gerrit
111
112 - job-template:
113     name: 'qtip-merged-notebook-{stream}'
114
115     disabled: '{obj:disabled}'
116
117     parameters:
118       - project-parameter:
119           project: $GERRIT_PROJECT
120           branch: '{branch}'
121       - string:
122           name: GS_URL
123           default: '$GS_BASE{gs-pathname}'
124           description: "Directory where the build artifact will be located upon the completion of the build."
125
126     scm:
127       - git-scm
128
129     triggers:
130       - gerrit:
131           server-name: 'gerrit.opnfv.org'
132           trigger-on:
133             - change-merged-event
134             - comment-added-contains-event:
135                 comment-contains-value: 'remerge'
136           projects:
137             - project-compare-type: 'ANT'
138               project-pattern: '*'
139               branches:
140                 - branch-compare-type: 'ANT'
141                   branch-pattern: '**/{branch}'
142               file-paths:
143                 - compare-type: ANT
144                   pattern: '**/*ipynb'
145
146     builders:
147       - remove-old-docs-from-opnfv-artifacts
148
149 ################################
150 ## job builders
151 #################################
152 - builder:
153     name: qtip-unit-tests-and-docs-build
154     builders:
155       - shell: |
156           #!/bin/bash
157           set -o errexit
158           set -o pipefail
159           set -o xtrace
160
161           tox
162
163 # modified from upload-under-review-docs-to-opnfv-artifacts
164 # in global/releng-macro.yml
165 - builder:
166     name: upload-under-review-notebooks-to-opnfv-artifacts
167     builders:
168       - shell: |
169           #!/bin/bash
170           set -o errexit
171           set -o pipefail
172           set -o xtrace
173           export PATH=$PATH:/usr/local/bin/
174
175           [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
176
177           echo
178           echo "###########################"
179           echo "UPLOADING DOCS UNDER REVIEW"
180           echo "###########################"
181           echo
182
183           gs_base="artifacts.opnfv.org/$PROJECT/review"
184           gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
185           local_path="upload/$GERRIT_CHANGE_NUMBER"
186
187           mkdir -p $local_path
188
189           git diff HEAD~1 --name-status | grep -E "[AM]\t.+\.ipynb$" | awk '{print $2}' \
190             | xargs -I '{}' cp '{}' $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