Merge "doctor: workaround for bug of set-functest-env.sh"
[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-merge-{stream}'
11     stream:
12         - master:
13             branch: '{stream}'
14             gs-pathname: ''
15             disabled: false
16         - danube:
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         - upload-under-review-notebooks-to-opnfv-artifacts
65     publishers:
66         - publish-coverage
67
68 - job-template:
69     name: 'qtip-merge-{stream}'
70
71     disabled: '{obj:disabled}'
72
73     parameters:
74         - project-parameter:
75             project: $GERRIT_PROJECT
76             branch: '{branch}'
77         - string:
78             name: GS_URL
79             default: '$GS_BASE{gs-pathname}'
80             description: "Directory where the build artifact will be located upon the completion of the build."
81         - string:
82             name: GERRIT_REFSPEC
83             default: 'refs/heads/{branch}'
84             description: "JJB configured GERRIT_REFSPEC parameter"
85
86     scm:
87         - git-scm
88
89     triggers:
90         - gerrit:
91             server-name: 'gerrit.opnfv.org'
92             trigger-on:
93                 - change-merged-event
94                 - comment-added-contains-event:
95                     comment-contains-value: 'remerge'
96             projects:
97                 - project-compare-type: 'ANT'
98                   project-pattern: '*'
99                   branches:
100                       - branch-compare-type: 'ANT'
101                         branch-pattern: '**/{branch}'
102                   file-paths:
103                       - compare-type: ANT
104                         pattern: examples/**
105
106     builders:
107         - remove-old-docs-from-opnfv-artifacts
108
109 ################################
110 ## job builders
111 #################################
112 - builder:
113     name: qtip-unit-tests-and-docs-build
114     builders:
115         - shell: |
116             #!/bin/bash
117             set -o errexit
118             set -o pipefail
119             set -o xtrace
120
121             tox
122
123 # modified from upload-under-review-docs-to-opnfv-artifacts in global/releng-macro.yml
124 - builder:
125     name: upload-under-review-notebooks-to-opnfv-artifacts
126     builders:
127         - shell: |
128             #!/bin/bash
129             set -o errexit
130             set -o pipefail
131             set -o xtrace
132             export PATH=$PATH:/usr/local/bin/
133
134             [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
135             [[ -d examples ]] || exit 0
136
137             echo
138             echo "###########################"
139             echo "UPLOADING DOCS UNDER REVIEW"
140             echo "###########################"
141             echo
142
143             gs_base="artifacts.opnfv.org/$PROJECT/review"
144             gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
145             local_path="upload/$GERRIT_CHANGE_NUMBER"
146
147             mkdir -p upload
148             cp -r examples "$local_path"
149             gsutil -m cp -r "$local_path" "gs://$gs_base"
150
151             echo "Document link(s):" >> gerrit_comment.txt
152             find "$local_path" | grep -e 'ipynb$' | \
153                 sed -e "s|^$local_path|    https://nbviewer.jupyter.org/urls/$gs_path|" >> gerrit_comment.txt