Fix for UDS build job
[infra/cicd.git] / jjb / onap / uds / uds-daily-build-package-promote.yaml
1 # ============LICENSE_START=======================================================
2 #  Copyright (C) 2019 Nordix Foundation.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the 'License');
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an 'AS IS' BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
18 ---
19 - project:
20     name: 'uds-daily-build-package-promote'
21     projects: 'onap/sdc local/onap/uds/sdc-customization'
22     project-name:
23       - uds
24     branches: 20.2 master
25     project_directories: sdc sdc-customization
26     project_versions:
27     mvn_params: '-DskipTests -Pdocker'
28     # mvn_params: '-DskipTests -Pdocker' # re-enable when unit tests pass
29     mvn_settings_xml_version:
30     mvn_version: '3.6.0'
31     docker_images: '
32       uds/sdc-cassandra-init,
33       uds/sdc-backend-init,
34       uds/sdc-be-plugin/etsi-nfv-nsd-csar,
35       uds/sdc-be-plugin/vf-csar,
36       uds/sdc-customization/eo-sdc-backend-init,
37       uds/sdc-customization/eo-cassandra-init,
38       uds/sdc-backend,
39       uds/sdc-onboard-backend,
40       uds/sdc-frontend,
41       uds/sdc-cassandra,
42       uds/sdc-simulator
43     '
44     docker_image_artifact_directory: $WORKSPACE/artifacts/images
45     artifactory_docker_images_path: onap/uds/images
46     artifact_paths: 'sdc/catalog-be/target/catalog-be-*.war'
47     artifactory_artifact_path: onap/uds
48     artifact_directory: $WORKSPACE/artifacts/artifacts
49     artifactory_repo_archive_path: onap/uds/releases
50     repo_archive_artifact_directory: $WORKSPACE/artifacts/repos
51     grep_parameters: -oP (?<=uds.version>)[^<]+
52     archive_name: uds
53     pom_location: sdc/pom.xml
54     workspace: /home/jenkins/nordix/slave_root/workspace/
55     node: onap-uds-build-ubuntu1804
56
57     jobs:
58       - '{project-name}-daily-build-package-promote'
59       - '{project-name}-build'
60       - '{project-name}-package-artifacts'
61       - '{project-name}-package-images'
62       - '{project-name}-package-repositories'
63       - '{project-name}-promote-artifacts'
64       - '{project-name}-promote-images'
65       - '{project-name}-promote-repositories'
66
67
68 - job-template:
69     name: '{project-name}-daily-build-package-promote'
70     description: 'Job for building, packing and pushing UDS artifacts including sources, docker images and other arifacts to Artifactory'
71     project-type: 'multijob'
72     workspace: '{workspace}'
73     node: '{node}'
74     parameters:
75       - multi-project-parameters:
76           projects: '{projects}'
77           branches: '{branches}'
78           project_directories: '{project_directories}'
79           project_versions: '{project_versions}'
80       - git-parameters
81       - maven-parameters:
82           mvn_params: '{mvn_params}'
83           mvn_settings_xml_version: '{mvn_settings_xml_version}'
84           mvn_version: '{mvn_version}'
85       - artifact_parameters:
86           artifact_paths: '{artifact_paths}'
87           artifactory_artifact_path: '{artifactory_artifact_path}'
88           artifact_directory: '{artifact_directory}'
89       - artifactory-parameters
90       - docker-archive-parameters:
91           docker_images: '{docker_images}'
92           artifactory_docker_images_path: '{artifactory_docker_images_path}'
93           docker_image_artifact_directory: '{docker_image_artifact_directory}'
94       - repo-archive-parameters:
95           grep_parameters: '{grep_parameters}'
96           pom_location: '{pom_location}'
97           archive_name: '{archive_name}'
98           artifactory_repo_archive_path: '{artifactory_repo_archive_path}'
99           repo_archive_artifact_directory: '{repo_archive_artifact_directory}'
100
101     builders:
102       - 'pull-source-repositories'
103       - 'generate-build-metadata'
104       - multijob:
105           name: Build
106           condition: SUCCESSFUL
107           projects:
108             - name: '{project-name}-build'
109               current-parameters: true
110               node-parameters: true
111               abort-all-job: false
112               kill-phase-on: FAILURE
113               property-file: $WORKSPACE/build.properties
114       - multijob:
115           name: Package
116           condition: SUCCESSFUL
117           execution-type: SEQUENTIALLY
118           projects:
119             - name: '{project-name}-package-artifacts'
120               current-parameters: true
121               node-parameters: true
122               abort-all-job: false
123               kill-phase-on: FAILURE
124               property-file: $WORKSPACE/build.properties
125             - name: '{project-name}-package-images'
126               current-parameters: true
127               node-parameters: true
128               abort-all-job: false
129               kill-phase-on: FAILURE
130               property-file: $WORKSPACE/build.properties
131             - name: '{project-name}-package-repositories'
132               current-parameters: true
133               node-parameters: true
134               abort-all-job: false
135               kill-phase-on: FAILURE
136               property-file: $WORKSPACE/build.properties
137       - multijob:
138           name: Promote
139           condition: SUCCESSFUL
140           execution-type: PARALLEL
141           projects:
142             - name: '{project-name}-promote-artifacts'
143               current-parameters: true
144               node-parameters: true
145               abort-all-job: false
146               kill-phase-on: FAILURE
147               property-file: $WORKSPACE/build.properties
148             - name: '{project-name}-promote-images'
149               current-parameters: true
150               node-parameters: true
151               abort-all-job: false
152               kill-phase-on: FAILURE
153               property-file: $WORKSPACE/build.properties
154             - name: '{project-name}-promote-repositories'
155               current-parameters: true
156               node-parameters: true
157               abort-all-job: false
158               kill-phase-on: FAILURE
159               property-file: $WORKSPACE/build.properties
160     triggers:
161       - timed: "@midnight"
162       - gerrit:
163           server-name: 'Nordix Gerrit'
164           trigger-on:
165             - change-merged-event
166             - comment-added-contains-event:
167                 comment-contains-value: 'remerge'
168           projects:
169             - project-compare-type: 'PLAIN'
170               project-pattern: 'onap/sdc'
171               branches:
172                 - branch-compare-type: 'PLAIN'
173                   branch-pattern: '20.2'
174             - project-compare-type: 'PLAIN'
175               project-pattern: 'local/onap/uds/sdc-customization'
176               branches:
177                 - branch-compare-type: 'PLAIN'
178                   branch-pattern: 'master'
179
180     wrappers:
181       - openstack:
182           single-use: True
183
184
185 - job-template:
186     name: '{project-name}-build'
187     description: 'Job for building out uds repositories'
188     workspace: '{workspace}'
189     node: '{node}'
190
191     builders:
192       - 'maven-build-repositories'
193
194
195 - job-template:
196     name: '{project-name}-package-artifacts'
197     description: 'Job for archiving uds artifacts (.war, .jar files etc.)'
198     workspace: '{workspace}'
199     node: '{node}'
200
201     builders:
202       - 'collect-file-artifacts'
203
204
205 - job-template:
206     name: '{project-name}-package-images'
207     description: 'Job for archiving uds docker images'
208     workspace: '{workspace}'
209     node: '{node}'
210
211     builders:
212       - 'package-docker-images'
213
214
215 - job-template:
216     name: '{project-name}-package-repositories'
217     description: 'Job for archiving uds source repos (sdc, sdc-customization)'
218     workspace: '{workspace}'
219     node: '{node}'
220
221     builders:
222       - 'maven-clean-repositories'
223       - 'package-source-repositories'
224
225
226 - job-template:
227     name: '{project-name}-promote-artifacts'
228     description: 'Job for pushing uds file artifacts (.war, .jar files etc.) to Artifactory'
229     workspace: '{workspace}'
230     node: '{node}'
231
232     builders:
233       - 'promote-file-artifacts-to-artifactory'
234     wrappers:
235       - 'artifactory-credentials'
236
237
238 - job-template:
239     name: '{project-name}-promote-images'
240     description: 'Job for pushing uds docker images to Artifactory'
241     workspace: '{workspace}'
242     node: '{node}'
243
244     builders:
245       - 'promote-docker-images-to-artifactory'
246     wrappers:
247       - 'artifactory-credentials'
248
249
250 - job-template:
251     name: '{project-name}-promote-repositories'
252     description: 'Job for pushing uds source repositories (sdc, sdc-customization) to Artifactory'
253     workspace: '{workspace}'
254     node: '{node}'
255
256     builders:
257       - 'promote-source-repositories-to-artifactory'
258     wrappers:
259       - 'artifactory-credentials'