Add python verify template
[releng/builder.git] / jjb / releng-templates.yaml
1 - job-template:
2     name: '{name}-verify-python-{stream}'
3
4     # Job template for python verify jobs
5     #
6     # The purpose of this job template is to run tox for projects using this
7     # template.
8     #
9     # Required Variables:
10     #     stream:    release stream (eg. stable-lithium or beryllium)
11     #     branch:    git branch (eg. stable/lithium or master)
12     #     toxdir:    directory containing the project's tox.ini relative to
13     #                the workspace.
14
15     project-type: freestyle
16     node: dynamic_verify
17     concurrent: true
18
19     logrotate:
20         daysToKeep: '7'
21         numToKeep: '-1'
22         artifactDaysToKeep: '-1'
23         artifactNumToKeep: '-1'
24
25     parameters:
26         - project-parameter:
27             project: '{project}'
28         - gerrit-parameter:
29             branch: '{branch}'
30         - gerrit-refspec-parameter:
31             refspec: 'refs/heads/{branch}'
32
33     scm:
34         - git:
35             credentials-id: '{ssh-credentials}'
36             url: '$GIT_BASE'
37             basedir: 'repo'
38             refspec: '$GERRIT_REFSPEC'
39             branches:
40                 - 'origin/$GERRIT_BRANCH'
41             skip-tag: true
42             choosing-strategy: 'gerrit'
43
44     wrappers:
45         - build-timeout
46         - ssh-agent-credentials:
47             users:
48                 - '{ssh-credentials}'
49
50     triggers:
51         - gerrit:
52             server-name: 'OpenDaylight'
53             trigger-on:
54                 - patchset-created-event:
55                     exclude-drafts: 'true'
56                     exclude-trivial-rebase: 'false'
57                     exclude-no-code-change: 'true'
58                 - draft-published-event
59                 - comment-added-contains-event:
60                     comment-contains-value: 'recheck'
61                 - comment-added-contains-event:
62                     comment-contains-value: 'reverify'
63             projects:
64               - project-compare-type: 'ANT'
65                 project-pattern: '{project}'
66                 branches:
67                   - branch-compare-type: 'ANT'
68                     branch-pattern: '**/{branch}'
69                 file-paths:
70                     - compare-type: ANT
71                       pattern: '{toxdir}/**'
72
73     builders:
74         - shell: |
75             virtualenv $WORKSPACE/venv-tox
76             source $WORKSPACE/venv-tox/bin/activate
77             pip install --upgrade pip
78             pip install --upgrade tox argparse
79             pip freeze
80             cd $WORKSPACE/repo/{toxdir}
81             tox
82
83     publishers:
84         - email-notification:
85             email-prefix: '[{project}]'