Builds and archives uds artifacts
[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_settings_xml_version:
28     docker_images: '
29       uds/sdc-cassandra-init,
30       uds/sdc-backend-init,
31       uds/sdc-be-plugin/etsi-nfv-nsd-csar,
32       uds/sdc-be-plugin/vf-csar,
33       uds/sdc-customization/eo-sdc-backend-init,
34       uds/sdc-customization/eo-cassandra-init,
35       uds/sdc-backend,
36       uds/sdc-onboard-backend,
37       uds/sdc-frontend,
38       uds/sdc-cassandra,
39       uds/sdc-simulator
40     '
41     docker_image_artifact_directory: $WORKSPACE/artifacts/images
42     artifactory_docker_images_path: onap/uds/images
43     artifact_paths: 'sdc/catalog-be/target/catalog-be-*.war'
44     artifactory_artifact_path: onap/uds
45     artifact_directory: $WORKSPACE/artifacts/artifacts
46     artifactory_repo_archive_path: onap/uds/releases
47     repo_archive_artifact_directory: $WORKSPACE/artifacts/repos
48     grep_parameters: -oP (?<=uds.version>)[^<]+
49     archive_name: uds
50     pom_location: sdc/pom.xml
51     workspace: /home/jenkins/nordix/slave_root/workspace/
52     node: onap-uds-build-ubuntu1804
53
54     jobs:
55       - '{project-name}-daily-build-package-promote'
56       - '{project-name}-build'
57       - '{project-name}-package-artifacts'
58       - '{project-name}-package-images'
59       - '{project-name}-package-repositories'
60       - '{project-name}-promote-artifacts'
61       - '{project-name}-promote-images'
62       - '{project-name}-promote-repositories'
63
64
65 - job-template:
66     name: '{project-name}-daily-build-package-promote'
67     description: 'Job for building, packing and pushing UDS artifacts including sources, docker images and other arifacts to Artifactory'
68     project-type: 'multijob'
69     workspace: '{workspace}'
70     node: '{node}'
71     parameters:
72       - multi-project-parameters:
73           projects: '{projects}'
74           branches: '{branches}'
75           project_directories: '{project_directories}'
76           project_versions: '{project_versions}'
77       - git-parameters
78       - maven-parameters:
79           mvn_settings_xml_version: '{mvn_settings_xml_version}'
80       - artifact_parameters:
81           artifact_paths: '{artifact_paths}'
82           artifactory_artifact_path: '{artifactory_artifact_path}'
83           artifact_directory: '{artifact_directory}'
84       - artifactory-parameters
85       - docker-archive-parameters:
86           docker_images: '{docker_images}'
87           artifactory_docker_images_path: '{artifactory_docker_images_path}'
88           docker_image_artifact_directory: '{docker_image_artifact_directory}'
89       - repo-archive-parameters:
90           grep_parameters: '{grep_parameters}'
91           pom_location: '{pom_location}'
92           archive_name: '{archive_name}'
93           artifactory_repo_archive_path: '{artifactory_repo_archive_path}'
94           repo_archive_artifact_directory: '{repo_archive_artifact_directory}'
95
96     builders:
97       - 'pull-source-repositories'
98       - 'generate-build-metadata'
99       - multijob:
100           name: Build
101           condition: SUCCESSFUL
102           projects:
103             - name: '{project-name}-build'
104               current-parameters: true
105               node-parameters: true
106               abort-all-job: false
107               kill-phase-on: FAILURE
108               property-file: $WORKSPACE/build.properties
109       - multijob:
110           name: Package
111           condition: SUCCESSFUL
112           execution-type: SEQUENTIALLY
113           projects:
114             - name: '{project-name}-package-artifacts'
115               current-parameters: true
116               node-parameters: true
117               abort-all-job: false
118               kill-phase-on: FAILURE
119               property-file: $WORKSPACE/build.properties
120             - name: '{project-name}-package-images'
121               current-parameters: true
122               node-parameters: true
123               abort-all-job: false
124               kill-phase-on: FAILURE
125               property-file: $WORKSPACE/build.properties
126             - name: '{project-name}-package-repositories'
127               current-parameters: true
128               node-parameters: true
129               abort-all-job: false
130               kill-phase-on: FAILURE
131               property-file: $WORKSPACE/build.properties
132       - multijob:
133           name: Promote
134           condition: SUCCESSFUL
135           execution-type: PARALLEL
136           projects:
137             - name: '{project-name}-promote-artifacts'
138               current-parameters: true
139               node-parameters: true
140               abort-all-job: false
141               kill-phase-on: FAILURE
142               property-file: $WORKSPACE/build.properties
143             - name: '{project-name}-promote-images'
144               current-parameters: true
145               node-parameters: true
146               abort-all-job: false
147               kill-phase-on: FAILURE
148               property-file: $WORKSPACE/build.properties
149             - name: '{project-name}-promote-repositories'
150               current-parameters: true
151               node-parameters: true
152               abort-all-job: false
153               kill-phase-on: FAILURE
154               property-file: $WORKSPACE/build.properties
155     triggers:
156       - timed: "@midnight"
157     wrappers:
158       - openstack:
159           single-use: True
160       - credentials-binding:
161         - username-password-separated:
162             credential-id: infra-nordix-artifactory-api-key
163             username: ARTIFACTORY_USER
164             password: ARTIFACTORY_API_KEY
165
166 - job-template:
167     name: '{project-name}-build'
168     description: 'Job for building out uds repositories'
169     workspace: '{workspace}'
170     node: '{node}'
171
172     builders:
173       - 'maven-build-repositories'
174
175
176 - job-template:
177     name: '{project-name}-package-artifacts'
178     description: 'Job for archiving uds artifacts (.war, .jar files etc.)'
179     workspace: '{workspace}'
180     node: '{node}'
181
182     builders:
183       - 'collect-file-artifacts'
184
185
186 - job-template:
187     name: '{project-name}-package-images'
188     description: 'Job for archiving uds docker images'
189     workspace: '{workspace}'
190     node: '{node}'
191
192     builders:
193       - 'package-docker-images'
194
195
196 - job-template:
197     name: '{project-name}-package-repositories'
198     description: 'Job for archiving uds source repos (sdc, sdc-customization)'
199     workspace: '{workspace}'
200     node: '{node}'
201
202     builders:
203       - 'maven-clean-repositories'
204       - 'package-source-repositories'
205
206
207 - job-template:
208     name: '{project-name}-promote-artifacts'
209     description: 'Job for pushing uds file artifacts (.war, .jar files etc.) to Artifactory'
210     workspace: '{workspace}'
211     node: '{node}'
212
213     builders:
214       - 'promote-file-artifacts-to-artifactory'
215
216 - job-template:
217     name: '{project-name}-promote-images'
218     description: 'Job for pushing uds docker images to Artifactory'
219     workspace: '{workspace}'
220     node: '{node}'
221
222     builders:
223       - 'promote-docker-images-to-artifactory'
224
225 - job-template:
226     name: '{project-name}-promote-repositories'
227     description: 'Job for pushing uds source repositories (sdc, sdc-customization) to Artifactory'
228     workspace: '{workspace}'
229     node: '{node}'
230
231     builders:
232       - 'promote-source-repositories-to-artifactory'