Run test for multiple layers on IEC blueprint
[ci-management.git] / jjb / akraino-templates / akraino-iec-templates.yaml
1 ---
2 - job-template:
3     id: akraino-iec-install
4     name: 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}'
5     disabled: '{obj:disabled}'
6     concurrent: false
7     node: '{slave-label}'
8     properties:
9       - throttle:
10           enabled: true
11           max-total: 4
12           max-per-node: 1
13           option: 'project'
14       - build-blocker:
15           use-build-blocker: true
16           blocking-jobs:
17             - '.*-fuel-{deploy_type}-.*'
18             - '.*-compass-{deploy_type}-.*'
19           block-level: 'NODE'
20
21     wrappers:
22       - build-name:
23           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE'
24
25     triggers:
26       - 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}-trigger'
27
28     parameters:
29       - lf-infra-parameters:
30           project: '{project}'
31           stream: '{stream}'
32           branch: '{branch}'
33       - '{project}-defaults'
34       - '{installer}-{os}-defaults'
35       - string:
36           name: DEPLOY_SCENARIO
37           default: '{scenario}'
38       - string:
39           name: IEC_TYPE
40           default: '{iecType}'
41
42     builders:
43       - trigger-builds:
44           - project: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
45             current-parameters: true
46             predefined-parameters:
47               DEPLOY_SCENARIO={scenario}
48             same-node: true
49             block: true
50           - project: 'validation-enea-daily-{stream}'
51             same-node: true
52             current-parameters: true
53             predefined-parameters: |
54               CLUSTER_MASTER_IP=$K8S_MASTER_IP
55               CLUSTER_SSH_USER=$K8S_SSH_USER
56               CLUSTER_SSH_PASSWORD=$K8S_SSH_PASSWORD
57               CLUSTER_SSH_KEY=$K8S_SSH_KEY
58               BLUEPRINT={project-name}
59               VERSION=master
60               OPTIONAL=false
61             block: true
62           - project:
63               !j2: |
64                 {%- for uc in usecase -%}
65                 iec-{{ iecType }}-install-{{ uc | first }}-{{ installer }}-{{ deploy_type }}-{{ os }}-daily-{{ stream }}
66                 {%- if not loop.last -%},{%- endif -%}
67                 {%- endfor %}
68             current-parameters: true
69             same-node: true
70             block: true
71             block-thresholds:
72               build-step-failure-threshold: 'never'
73               failure-threshold: 'never'
74               unstable-threshold: 'FAILURE'
75           - project: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
76             current-parameters: false
77             predefined-parameters: |
78               DEPLOY_SCENARIO={scenario}
79               IEC_TYPE={iecType}
80             same-node: true
81             block: true
82
83 - job-template:
84     id: akraino-iec-deploy
85     name: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
86     concurrent: true
87     node: '{slave-label}'
88     properties: &properties
89       - throttle:
90           enabled: true
91           max-total: 4
92           max-per-node: 1
93           option: 'project'
94       - build-blocker:
95           use-build-blocker: true
96           blocking-jobs:
97             - '.*-{iecType}-deploy-{installer}-{deploy_type}-.*'
98             - '.*-{iecType}-destroy-{installer}-{deploy_type}-.*'
99             - '.*-{iecType}-install-.*-{installer}-{deploy_type}-.*'
100           block-level: 'NODE'
101
102     parameters:
103       - lf-infra-parameters:
104           project: '{project}'
105           stream: '{stream}'
106           branch: '{branch}'
107       - '{project}-defaults'
108       - '{installer}-{os}-defaults'
109       - string:
110           name: DEPLOY_SCENARIO
111           default: '{scenario}'
112       - string:
113           name: IEC_TYPE
114           default: '{iecType}'
115       - string:
116           name: EXTRA_ARGS
117           default: '-o {os}'
118
119     wrappers: &wrappers
120       - build-name:
121           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE'
122
123     scm: &scm
124       - git:
125           credentials-id: '{jenkins-ssh-credential}'
126           url: '{git-url}/{project}.git'
127           refspec: ''
128           branches:
129             - 'refs/heads/{branch}'
130           skip-tag: true
131           wipe-workspace: true
132           submodule:
133             disable: true
134             recursive: false
135             timeout: '{submodule-timeout}'
136           choosing-strategy: default
137
138     builders:
139       - description-setter:
140           description: "POD: $NODE_NAME"
141       - conditional-step:
142           condition-kind: regex-match
143           regex: 'compass'
144           label: '{installer}'
145           steps:
146             - shell:
147                 !include-raw-escape: ../iec/iec-compass-build.sh
148             - shell:
149                 !include-raw-escape: ../iec/iec-compass-deploy.sh
150             - shell:
151                 !include-raw-escape: ../iec/iec-fdn-install.sh
152       - conditional-step:
153           condition-kind: regex-match
154           regex: 'fuel'
155           label: '{installer}'
156           steps:
157             - shell:
158                 !include-raw-escape: ../iec/iec-fuel-deploy.sh
159
160     publishers: &publishers
161       - email:
162           recipients: armband@enea.com
163       - lf-infra-publish
164
165 - job-template:
166     id: akraino-iec-destroy
167     name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
168     concurrent: true
169     node: '{slave-label}'
170     properties: *properties
171     parameters:
172       - lf-infra-parameters:
173           project: '{project}'
174           stream: '{stream}'
175           branch: '{branch}'
176       - '{project}-defaults'
177       - '{installer}-{os}-defaults'
178       - string:
179           name: DEPLOY_SCENARIO
180           default: '{scenario}'
181       - string:
182           name: IEC_TYPE
183           default: '{iecType}'
184       - string:
185           name: EXTRA_ARGS
186           default: '-EEE -o {os}'
187
188     wrappers: *wrappers
189     scm: *scm
190
191     builders:
192       - description-setter:
193           description: "POD: $NODE_NAME"
194       - shell:
195           !include-raw-escape: ../iec/iec-{installer}-destroy.sh
196
197     publishers: *publishers
198
199 - job-template:
200     id: akraino-iec-install-usecase
201     name: 'iec-{iecType}-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
202     concurrent: true
203     node: '{slave-label}'
204     properties: *properties
205
206     parameters:
207       - lf-infra-parameters:
208           project: '{project}'
209           stream: '{stream}'
210           branch: '{branch}'
211       - '{project}-defaults'
212       - '{installer}-{os}-defaults'
213
214     wrappers:
215       - build-name:
216           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
217
218     scm: *scm
219
220     builders:
221       - shell:
222           !include-raw-escape: ../iec/iec-{usecase}.sh
223
224     publishers: *publishers
225