Merge "Configure Sweetcomb archive artifacts"
[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       - '1904':
35           branch: 'stable/1904'
36           repo-stream-part: 'stable.1904'
37       - '1901':
38           branch: 'stable/1901'
39           repo-stream-part: 'stable.1901'
40
41 - project:
42     name: sweetcomb-view
43     views:
44       - project-view
45     project-name: sweetcomb
46
47 - job-template:
48     name: 'sweetcomb-verify-{stream}-{os}'
49
50     project-type: freestyle
51     node: '{os}-us'
52     concurrent: true
53
54     build-discarder:
55       daysToKeep: '{build-days-to-keep}'
56       numToKeep: 100
57       artifactDaysToKeep: '{build-artifact-days-to-keep}'
58       artifactNumToKeep: '{build-artifact-num-to-keep}'
59
60     parameters:
61       - project-parameter:
62           project: '{project}'
63       - gerrit-parameter:
64           branch: '{branch}'
65       - os-parameter:
66           os: '{os}'
67       - repo-name-parameter:
68           repo-name: '{repo-stream-part}.{repo-os-part}'
69       - stream-parameter:
70           stream: '{stream}'
71
72     scm:
73       - gerrit-trigger-scm:
74           credentials-id: 'jenkins-gerrit-credentials'
75           refspec: '$GERRIT_REFSPEC'
76           choosing-strategy: 'gerrit'
77
78     wrappers:
79       - fdio-infra-wrappers:
80           build-timeout: 120
81
82     triggers:
83       - gerrit-trigger-checkstyle:
84           name: '{project}'
85           branch: '{branch}'
86       - gerrit-trigger-patch-submitted:
87           name: '{project}'
88           branch: '{branch}'
89
90     builders:
91       - config-file-provider:
92           files:
93             - file-id: '.packagecloud'
94               target: '/root'
95       - config-file-provider:
96           files:
97             - file-id: 'packagecloud_api'
98               target: '/root'
99       - shell:
100           !include-raw-escape: include-raw-sweetcomb-checkstyle.sh
101       - shell:
102           !include-raw-escape:
103           - include-raw-sweetcomb-build.sh
104     publishers:
105       - archive:
106           artifacts: >
107             **/build-root/build-package/*.rpm,
108             **/build-root/build-package/*.deb,
109           allow-empty: 'true'
110           fingerprint: false
111           only-if-success: true
112           default-excludes: false
113       - fdio-infra-shiplogs:
114           maven-version: 'mvn33-new'
115       - naginator:
116           rerun-unstable-builds: false
117           max-failed-builds: 1
118           fixed-delay: 90
119
120     publishers:
121       - fdio-infra-shiplogs:
122           maven-version: 'mvn33-new'
123
124 - job-template:
125     name: 'sweetcomb-merge-{stream}-{os}'
126
127     project-type: freestyle
128     node: '{os}-us'
129
130     build-discarder:
131       daysToKeep: '{build-days-to-keep}'
132       numToKeep: 100
133       artifactDaysToKeep: '{build-artifact-days-to-keep}'
134       artifactNumToKeep: '{build-artifact-num-to-keep}'
135
136     archive-artifacts: >
137         **/build-root/build-package/*.rpm
138         **/build-root/build-package/*.deb,
139     allow-empty: 'true'
140     fingerprint: false
141     only-if-success: true
142     default-excludes: false
143
144     parameters:
145       - project-parameter:
146           project: '{project}'
147       - gerrit-parameter:
148           branch: '{branch}'
149       - os-parameter:
150           os: '{os}'
151       - stream-parameter:
152           stream: '{stream}'
153       - repo-name-parameter:
154           repo-name: '{repo-stream-part}.{repo-os-part}'
155       - string:
156           name: ARCHIVE_ARTIFACTS
157           default: '{archive-artifacts}'
158           description: Artifacts to archive to the logs server.
159
160
161     scm:
162       - gerrit-trigger-scm:
163           credentials-id: 'jenkins-gerrit-credentials'
164           refspec: ''
165           choosing-strategy: 'default'
166
167     wrappers:
168       - fdio-infra-wrappers:
169           build-timeout: '{build-timeout}'
170
171     triggers:
172       - gerrit-trigger-patch-merged:
173           name: '{project}'
174           branch: '{branch}'
175
176     builders:
177       - config-file-provider:
178           files:
179             - file-id: '.packagecloud'
180               target: '/root'
181       - config-file-provider:
182           files:
183             - file-id: 'packagecloud_api'
184               target: '/root'
185       - shell:
186           !include-raw-escape: include-raw-sweetcomb-checkstyle.sh
187       - shell:
188           !include-raw-escape:
189           - include-raw-sweetcomb-build.sh
190       - shell:
191           !include-raw-escape:
192           - ../scripts/packagecloud_push.sh
193     publishers:
194       - archive:
195           artifacts: >
196             **/build-root/build-package/*.rpm,
197             **/build-root/build-package/*.deb,
198           allow-empty: 'true'
199           fingerprint: false
200           only-if-success: true
201           default-excludes: false
202       - fdio-infra-shiplogs:
203           maven-version: 'mvn33-new'
204       - naginator:
205           rerun-unstable-builds: false
206           max-failed-builds: 1
207           fixed-delay: 90