Adding sudo for docker command (just for testing)
[releng.git] / jjb / releng-jobs.yaml
1 - project:
2     name: builder-jobs
3     jobs:
4         - 'builder-verify-jjb'
5         - 'builder-merge'
6
7     project: 'releng'
8
9 - job-template:
10     name: builder-verify-jjb
11
12     project-type: freestyle
13
14     logrotate:
15         daysToKeep: 30
16         numToKeep: 10
17         artifactDaysToKeep: -1
18         artifactNumToKeep: -1
19
20     parameters:
21         - project-parameter:
22             project: '{project}'
23         - gerrit-parameter:
24             branch: 'master'
25     scm:
26         - gerrit-trigger-scm:
27             credentials-id: '{ssh-credentials}'
28             refspec: '$GERRIT_REFSPEC'
29             choosing-strategy: 'gerrit'
30
31     wrappers:
32         - ssh-agent-credentials:
33             user: '{ssh-credentials}'
34
35     triggers:
36         - gerrit:
37             trigger-on:
38                 - patchset-created-event:
39                     exclude-drafts: 'false'
40                     exclude-trivial-rebase: 'false'
41                     exclude-no-code-change: 'false'
42                 - draft-published-event
43                 - comment-added-contains-event:
44                     comment-contains-value: 'recheck'
45             projects:
46               - project-compare-type: 'ANT'
47                 project-pattern: 'releng'
48                 branches:
49                   - branch-compare-type: 'ANT'
50                     branch-pattern: '**/master'
51                 file-paths:
52                     - compare-type: ANT
53                       pattern: jjb/**
54                     - compare-type: ANT
55                       pattern: jjb-templates/**
56
57
58     builders:
59         - shell: |
60             source /opt/virtualenv/jenkins-job-builder/bin/activate
61             jenkins-jobs test /opt/jenkins-ci/builder/
62
63 - job-template:
64     name: 'builder-merge'
65
66     # builder-merge job to run JJB update
67     #
68     # This job's purpose is to update all the JJB
69
70     project-type: freestyle
71
72     logrotate:
73         daysToKeep: 30
74         numToKeep: 40
75         artifactDaysToKeep: -1
76         artifactNumToKeep: 5
77
78     parameters:
79         - project-parameter:
80             project: '{project}'
81         - gerrit-parameter:
82             branch: 'master'
83
84     scm:
85         - gerrit-trigger-scm:
86             credentials-id: '{ssh-credentials}'
87             refspec: ''
88             choosing-strategy: 'default'
89
90     wrappers:
91         - ssh-agent-credentials:
92             user: '{ssh-credentials}'
93
94     triggers:
95         - gerrit:
96             trigger-on:
97                 - change-merged-event
98                 - comment-added-contains-event:
99                     comment-contains-value: 'remerge'
100             projects:
101               - project-compare-type: 'ANT'
102                 project-pattern: 'releng'
103                 branches:
104                     - branch-compare-type: 'ANT'
105                       branch-pattern: '**/master'
106                 file-paths:
107                     - compare-type: ANT
108                       pattern: jjb/**
109
110     builders:
111         - shell: |
112                 source /opt/virtualenv/jenkins-job-builder/bin/activate
113                 cd /opt/jenkins-ci/releng
114                 git pull
115                 jenkins-jobs update --delete-old jjb/
116