ddfb718ca290395bf0ccf5b2500e0b0e5ed43796
[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     properties:
75       - logrotate
76
77     parameters:
78       - multi-project-parameters:
79           projects: '{projects}'
80           branches: '{branches}'
81           project_directories: '{project_directories}'
82           project_versions: '{project_versions}'
83       - git-parameters
84       - maven-parameters:
85           mvn_params: '{mvn_params}'
86           mvn_settings_xml_version: '{mvn_settings_xml_version}'
87           mvn_version: '{mvn_version}'
88       - artifact_parameters:
89           artifact_paths: '{artifact_paths}'
90           artifactory_artifact_path: '{artifactory_artifact_path}'
91           artifact_directory: '{artifact_directory}'
92       - artifactory-parameters
93       - docker-archive-parameters:
94           docker_images: '{docker_images}'
95           artifactory_docker_images_path: '{artifactory_docker_images_path}'
96           docker_image_artifact_directory: '{docker_image_artifact_directory}'
97       - repo-archive-parameters:
98           grep_parameters: '{grep_parameters}'
99           pom_location: '{pom_location}'
100           archive_name: '{archive_name}'
101           artifactory_repo_archive_path: '{artifactory_repo_archive_path}'
102           repo_archive_artifact_directory: '{repo_archive_artifact_directory}'
103
104     builders:
105       - 'pull-source-repositories'
106       - 'generate-build-metadata'
107       - multijob:
108           name: Build
109           condition: SUCCESSFUL
110           projects:
111             - name: '{project-name}-build'
112               current-parameters: true
113               node-parameters: true
114               abort-all-job: false
115               kill-phase-on: FAILURE
116               property-file: $WORKSPACE/build.properties
117       - multijob:
118           name: Package
119           condition: SUCCESSFUL
120           execution-type: SEQUENTIALLY
121           projects:
122             - name: '{project-name}-package-artifacts'
123               current-parameters: true
124               node-parameters: true
125               abort-all-job: false
126               kill-phase-on: FAILURE
127               property-file: $WORKSPACE/build.properties
128             - name: '{project-name}-package-images'
129               current-parameters: true
130               node-parameters: true
131               abort-all-job: false
132               kill-phase-on: FAILURE
133               property-file: $WORKSPACE/build.properties
134             - name: '{project-name}-package-repositories'
135               current-parameters: true
136               node-parameters: true
137               abort-all-job: false
138               kill-phase-on: FAILURE
139               property-file: $WORKSPACE/build.properties
140       - multijob:
141           name: Promote
142           condition: SUCCESSFUL
143           execution-type: PARALLEL
144           projects:
145             - name: '{project-name}-promote-artifacts'
146               current-parameters: true
147               node-parameters: true
148               abort-all-job: false
149               kill-phase-on: FAILURE
150               property-file: $WORKSPACE/build.properties
151             - name: '{project-name}-promote-images'
152               current-parameters: true
153               node-parameters: true
154               abort-all-job: false
155               kill-phase-on: FAILURE
156               property-file: $WORKSPACE/build.properties
157             - name: '{project-name}-promote-repositories'
158               current-parameters: true
159               node-parameters: true
160               abort-all-job: false
161               kill-phase-on: FAILURE
162               property-file: $WORKSPACE/build.properties
163     triggers:
164       - timed: "@midnight"
165       - gerrit:
166           server-name: 'Nordix Gerrit'
167           trigger-on:
168             - change-merged-event
169             - comment-added-contains-event:
170                 comment-contains-value: 'remerge'
171           projects:
172             - project-compare-type: 'PLAIN'
173               project-pattern: 'onap/sdc'
174               branches:
175                 - branch-compare-type: 'PLAIN'
176                   branch-pattern: '20.2'
177             - project-compare-type: 'PLAIN'
178               project-pattern: 'local/onap/uds/sdc-customization'
179               branches:
180                 - branch-compare-type: 'PLAIN'
181                   branch-pattern: 'master'
182
183     wrappers:
184       - openstack:
185           single-use: True
186
187
188 - job-template:
189     name: '{project-name}-build'
190     description: 'Job for building out uds repositories'
191     workspace: '{workspace}'
192     node: '{node}'
193
194     builders:
195       - 'maven-build-repositories'
196
197
198 - job-template:
199     name: '{project-name}-package-artifacts'
200     description: 'Job for archiving uds artifacts (.war, .jar files etc.)'
201     workspace: '{workspace}'
202     node: '{node}'
203
204     builders:
205       - 'collect-file-artifacts'
206
207
208 - job-template:
209     name: '{project-name}-package-images'
210     description: 'Job for archiving uds docker images'
211     workspace: '{workspace}'
212     node: '{node}'
213
214     builders:
215       - 'package-docker-images'
216
217
218 - job-template:
219     name: '{project-name}-package-repositories'
220     description: 'Job for archiving uds source repos (sdc, sdc-customization)'
221     workspace: '{workspace}'
222     node: '{node}'
223
224     builders:
225       - 'maven-clean-repositories'
226       - 'package-source-repositories'
227
228
229 - job-template:
230     name: '{project-name}-promote-artifacts'
231     description: 'Job for pushing uds file artifacts (.war, .jar files etc.) to Artifactory'
232     workspace: '{workspace}'
233     node: '{node}'
234
235     builders:
236       - 'promote-file-artifacts-to-artifactory'
237     wrappers:
238       - 'artifactory-credentials'
239
240
241 - job-template:
242     name: '{project-name}-promote-images'
243     description: 'Job for pushing uds docker images to Artifactory'
244     workspace: '{workspace}'
245     node: '{node}'
246
247     builders:
248       - 'promote-docker-images-to-artifactory'
249     wrappers:
250       - 'artifactory-credentials'
251
252
253 - job-template:
254     name: '{project-name}-promote-repositories'
255     description: 'Job for pushing uds source repositories (sdc, sdc-customization) to Artifactory'
256     workspace: '{workspace}'
257     node: '{node}'
258
259     builders:
260       - 'promote-source-repositories-to-artifactory'
261     wrappers:
262       - 'artifactory-credentials'