Add checkstyle and build to Sweetcomb verify job
[ci-management.git] / jjb / sweetcomb / sweetcomb.yaml
1 ---
2 #########################################################################
3 #
4 # Copyright (c) 2018 Intel and/or its affiliates.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at:
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #########################################################################
17
18 - project:
19     name: sweetcomb
20     jobs:
21       - 'sweetcomb-verify-{stream}-{os}'
22       - 'sweetcomb-merge-{stream}-{os}'
23
24     project: 'sweetcomb'
25     os:
26       - ubuntu1604:
27           repo-os-part: 'ubuntu.xenial.main'
28       - centos7:
29           repo-os-part: 'centos7'
30     stream:
31       - master:
32           branch: 'master'
33           repo-stream-part: 'master'
34       - '1901':
35           branch: 'stable/1901'
36           repo-stream-part: 'stable.1901'
37
38 - project:
39     name: sweetcomb-view
40     views:
41       - project-view
42     project-name: sweetcomb
43
44 - job-template:
45     name: 'sweetcomb-verify-{stream}-{os}'
46
47     project-type: freestyle
48     node: '{os}-us'
49     concurrent: true
50
51     build-discarder:
52       daysToKeep: '{build-days-to-keep}'
53       numToKeep: 100
54       artifactDaysToKeep: '{build-artifact-days-to-keep}'
55       artifactNumToKeep: '{build-artifact-num-to-keep}'
56
57     parameters:
58       - project-parameter:
59           project: '{project}'
60       - gerrit-parameter:
61           branch: '{branch}'
62       - os-parameter:
63           os: '{os}'
64       - repo-name-parameter:
65           repo-name: '{repo-stream-part}.{repo-os-part}'
66       - stream-parameter:
67           stream: '{stream}'
68
69     scm:
70       - gerrit-trigger-scm:
71           credentials-id: 'jenkins-gerrit-credentials'
72           refspec: '$GERRIT_REFSPEC'
73           choosing-strategy: 'gerrit'
74
75     wrappers:
76       - fdio-infra-wrappers:
77           build-timeout: 120
78
79     triggers:
80       - gerrit-trigger-checkstyle:
81           name: '{project}'
82           branch: '{branch}'
83
84     builders:
85       - config-file-provider:
86           files:
87             - file-id: '.packagecloud'
88               target: '/root'
89       - config-file-provider:
90           files:
91             - file-id: 'packagecloud_api'
92               target: '/root'
93       - shell:
94           !include-raw-escape: include-raw-sweetcomb-checkstyle.sh
95       - shell:
96           !include-raw-escape:
97           - include-raw-sweetcomb-build.sh
98     publishers:
99       - archive:
100           artifacts: >
101             **/build-root/build-package/*.rpm,
102             **/build-root/build-package/*.deb,
103           allow-empty: 'true'
104           fingerprint: false
105           only-if-success: true
106           default-excludes: false
107       - fdio-infra-shiplogs:
108           maven-version: 'mvn33-new'
109       - naginator:
110           rerun-unstable-builds: false
111           max-failed-builds: 1
112           fixed-delay: 90
113
114       - gerrit-trigger-patch-submitted:
115           name: '{project}'
116           branch: '{branch}'
117
118     publishers:
119       - fdio-infra-shiplogs:
120           maven-version: 'mvn33-new'
121
122 - job-template:
123     name: 'sweetcomb-merge-{stream}-{os}'
124
125     project-type: freestyle
126     node: '{os}-us'
127
128     build-discarder:
129       daysToKeep: '{build-days-to-keep}'
130       numToKeep: 100
131       artifactDaysToKeep: '{build-artifact-days-to-keep}'
132       artifactNumToKeep: '{build-artifact-num-to-keep}'
133
134     parameters:
135       - project-parameter:
136           project: '{project}'
137       - gerrit-parameter:
138           branch: '{branch}'
139       - os-parameter:
140           os: '{os}'
141       - stream-parameter:
142           stream: '{stream}'
143       - repo-name-parameter:
144           repo-name: '{repo-stream-part}.{repo-os-part}'
145
146     scm:
147       - gerrit-trigger-scm:
148           credentials-id: 'jenkins-gerrit-credentials'
149           refspec: ''
150           choosing-strategy: 'default'
151
152     wrappers:
153       - fdio-infra-wrappers:
154           build-timeout: '{build-timeout}'
155
156     triggers:
157       - gerrit-trigger-patch-merged:
158           name: '{project}'
159           branch: '{branch}'
160
161     builders:
162       - config-file-provider:
163           files:
164             - file-id: '.packagecloud'
165               target: '/root'
166       - config-file-provider:
167           files:
168             - file-id: 'packagecloud_api'
169               target: '/root'
170       - shell:
171           !include-raw-escape: include-raw-sweetcomb-checkstyle.sh
172       - shell:
173           !include-raw-escape:
174           - include-raw-sweetcomb-build.sh
175       - shell:
176           !include-raw-escape:
177           - ../scripts/packagecloud_push.sh
178     publishers:
179       - archive:
180           artifacts: >
181             **/build-root/build-package/*.rpm,
182             **/build-root/build-package/*.deb,
183           allow-empty: 'true'
184           fingerprint: false
185           only-if-success: true
186           default-excludes: false
187       - fdio-infra-shiplogs:
188           maven-version: 'mvn33-new'
189       - naginator:
190           rerun-unstable-builds: false
191           max-failed-builds: 1
192           fixed-delay: 90