[iec] Trigger all usecases in parent jobs
[ci-management.git] / jjb / iec / iec.yaml
1 ---
2 - project:
3     name: 'iec'
4     project-name: 'iec'
5     project: '{project-name}'
6     views:
7       - project-view
8     # -------------------------------
9     # BRANCH DEFINITIONS
10     # -------------------------------
11     stream:
12       - master:
13           branch: '{stream}'
14           gs-pathname: ''
15           disabled: false
16
17     # -------------------------------
18     # DEPLOY TYPE DEFINITIONS
19     # -------------------------------
20     deploy_type:
21       - fuel-baremetal:
22           slave-label: 'aarch64_dev'
23           scenario: 'k8-calico-iec-noha'
24       - fuel-virtual:
25           slave-label: 'aarch64_dev'
26           scenario: 'k8-calico-iec-noha'
27       - compass-virtual:
28           slave-label: 'aarch64_dev'
29           scenario: 'k8-calico-iec-noha'
30
31     # -------------------------------
32     # USECASE DEFINITIONS
33     # -------------------------------
34     usecase:
35       - seba_on_arm:
36           slave-label: 'aarch64_dev'
37           scenario: 'k8-calico-iec-noha'
38
39     jobs:
40       - 'iec-{deploy_type}-daily-{stream}'
41       - 'iec-deploy-{deploy_type}-daily-{stream}'
42       - 'iec-install-{usecase}-{deploy_type}-daily-{stream}'
43
44 ##############
45 # PARAMETERS #
46 ##############
47 - parameter:
48     name: 'iec-defaults'
49     parameters:
50       - string:
51           name: INSTALLER_IP
52           default: '10.20.0.2'
53           description: 'IP of the installer'
54       - string:
55           name: SSH_KEY
56           default: '/var/lib/opnfv/mcp.rsa'
57           description: 'Path to private SSH key to access environment nodes'
58       - string:
59           name: EXTERNAL_NETWORK
60           default: 'floating_net'
61           description: 'external network for test'
62       - string:
63           name: CI_DEBUG
64           default: 'false'
65           description: 'Show debug output information'
66 - parameter:
67     name: 'seba_on_arm-defaults'
68     parameters:
69       - string:
70           name: K8S_SSH_USER
71           default: 'ubuntu'
72           description: 'SSH username to connect to the K8s master '
73       - string:
74           name: K8S_SSH_PASSWORD
75           default: ''
76           description: 'SSH password to connect to the K8s master'
77       - string:
78           name: K8S_SSH_KEY
79           default: ''
80           description: 'SSH key to connect to the K8s master'
81
82 ########################
83 # job templates
84 ########################
85 - job-template:
86     name: 'iec-{deploy_type}-daily-{stream}'
87     disabled: '{obj:disabled}'
88     concurrent: false
89     node: '{slave-label}'
90     properties:
91       - throttle:
92           enabled: true
93           max-total: 4
94           max-per-node: 1
95           option: 'project'
96       - build-blocker:
97           use-build-blocker: true
98           blocking-jobs:
99             - '.*-{deploy_type}-daily-.*'
100           blocking-level: 'NODE'
101
102     wrappers:
103       - build-name:
104           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
105
106     triggers:
107       - 'iec-{deploy_type}-daily-{stream}-trigger'
108
109     parameters:
110       - lf-infra-parameters:
111           project: '{project}'
112           stream: '{stream}'
113           branch: '{branch}'
114       - '{project}-defaults'
115       - string:
116           name: DEPLOY_SCENARIO
117           default: '{scenario}'
118
119     builders:
120       - trigger-builds:
121           - project: 'iec-deploy-{deploy_type}-daily-{stream}'
122             current-parameters: false
123             predefined-parameters:
124               DEPLOY_SCENARIO={scenario}
125             same-node: true
126             block: true
127           - project:
128               !j2: |
129                 {%- for uc in usecase -%}
130                 iec-install-{{ uc | first }}-{{ deploy_type }}-daily-{{ stream }}
131                 {%- if not loop.last -%},{%- endif -%}
132                 {%- endfor %}
133             current-parameters: false
134             same-node: true
135             block: true
136
137 - job-template:
138     name: 'iec-deploy-{deploy_type}-daily-{stream}'
139     concurrent: true
140     node: '{slave-label}'
141     properties:
142       - throttle:
143           enabled: true
144           max-total: 4
145           max-per-node: 1
146           option: 'project'
147       - build-blocker:
148           use-build-blocker: true
149           blocking-jobs:
150             - '.*-deploy-{deploy_type}-daily-*'
151           blocking-level: 'NODE'
152
153     parameters:
154       - lf-infra-parameters:
155           project: '{project}'
156           stream: '{stream}'
157           branch: '{branch}'
158       - '{project}-defaults'
159       - string:
160           name: DEPLOY_SCENARIO
161           default: '{scenario}'
162
163     wrappers:
164       - build-name:
165           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
166
167     scm: &scm
168       - git:
169           credentials-id: '{jenkins-ssh-credential}'
170           url: '{git-url}/{project}.git'
171           refspec: ''
172           branches:
173             - 'refs/heads/{branch}'
174           skip-tag: true
175           wipe-workspace: true
176           submodule:
177             disable: true
178             recursive: false
179             timeout: '{submodule-timeout}'
180           choosing-strategy: default
181
182     builders:
183       - description-setter:
184           description: "POD: $NODE_NAME"
185       - conditional-step:
186           condition-kind: regex-match
187           regex: 'compass-.*'
188           label: '{deploy_type}'
189           steps:
190             - shell:
191                 !include-raw-escape: ./iec-compass-build.sh
192             - shell:
193                 !include-raw-escape: ./iec-compass-deploy.sh
194             - shell:
195                 !include-raw-escape: ./iec-compass-destroy.sh
196       - conditional-step:
197           condition-kind: regex-match
198           regex: 'fuel-.*'
199           label: '{deploy_type}'
200           steps:
201             - shell:
202                 !include-raw-escape: ./iec-fuel-deploy.sh
203
204     publishers:
205       - email:
206           recipients: armband@enea.com
207
208 - job-template:
209     name: 'iec-install-{usecase}-{deploy_type}-daily-{stream}'
210     concurrent: true
211     node: '{slave-label}'
212     properties:
213       - throttle:
214           enabled: true
215           max-total: 4
216           max-per-node: 1
217           option: 'project'
218       - build-blocker:
219           use-build-blocker: true
220           blocking-jobs:
221             - '.*-deploy-{deploy_type}-daily-*'
222             - '.*-install-{usecase}-{deploy_type}-daily-*'
223           blocking-level: 'NODE'
224
225     parameters:
226       - lf-infra-parameters:
227           project: '{project}'
228           stream: '{stream}'
229           branch: '{branch}'
230       - '{project}-defaults'
231       - '{usecase}-defaults'
232
233     wrappers:
234       - build-name:
235           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${deploy_type}'
236
237     scm: *scm
238
239     builders:
240       - shell:
241           !include-raw-escape: ./iec-{usecase}.sh
242
243     publishers:
244       - email:
245           recipients: armband@enea.com
246
247 ########################
248 # trigger macros
249 ########################
250 # CI PODs
251 # ----------------------------------------------------------------
252 # Akraino IEC CI Baremetal Triggers running against master branch
253 # ----------------------------------------------------------------
254 - trigger:
255     name: 'iec-fuel-virtual-daily-master-trigger'
256     triggers:
257       - timed: '0 1 * * *'
258 - trigger:
259     name: 'iec-fuel-baremetal-daily-master-trigger'
260     triggers:
261       - timed: ''
262 - trigger:
263     name: 'iec-compass-virtual-daily-master-trigger'
264     triggers:
265       - timed: '0 13 * * *'