iec: Add jobs for testing usecases
[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                 {%- for ph in phase -%}
66                 iec-{{ iecType }}-{{ ph }}-{{ uc }}-{{ installer }}-{{ deploy_type }}-{{ os }}-daily-{{ stream }}
67                 {%- if not loop.last -%},{%- endif -%}
68                 {%- endfor %}
69                 {%- if not loop.last -%},{%- endif -%}
70                 {%- endfor %}
71             current-parameters: true
72             same-node: true
73             block: true
74             block-thresholds:
75               build-step-failure-threshold: 'never'
76               failure-threshold: 'never'
77               unstable-threshold: 'FAILURE'
78           - project: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
79             current-parameters: false
80             predefined-parameters: |
81               DEPLOY_SCENARIO={scenario}
82               IEC_TYPE={iecType}
83             same-node: true
84             block: true
85
86 - job-template:
87     id: akraino-iec-deploy
88     name: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
89     concurrent: true
90     node: '{slave-label}'
91     properties: &properties
92       - throttle:
93           enabled: true
94           max-total: 4
95           max-per-node: 1
96           option: 'project'
97       - build-blocker:
98           use-build-blocker: true
99           blocking-jobs:
100             - '.*-{iecType}-deploy-{installer}-{deploy_type}-.*'
101             - '.*-{iecType}-destroy-{installer}-{deploy_type}-.*'
102             - '.*-{iecType}-install-.*-{installer}-{deploy_type}-.*'
103           block-level: 'NODE'
104
105     parameters:
106       - lf-infra-parameters:
107           project: '{project}'
108           stream: '{stream}'
109           branch: '{branch}'
110       - '{project}-defaults'
111       - '{installer}-{os}-defaults'
112       - string:
113           name: DEPLOY_SCENARIO
114           default: '{scenario}'
115       - string:
116           name: IEC_TYPE
117           default: '{iecType}'
118       - string:
119           name: EXTRA_ARGS
120           default: '-o {os}'
121
122     wrappers: &wrappers
123       - build-name:
124           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE'
125
126     scm: &scm
127       - git:
128           credentials-id: '{jenkins-ssh-credential}'
129           url: '{git-url}/{project}.git'
130           refspec: '$GERRIT_REFSPEC'
131           branches: '$GERRIT_BRANCH'
132           skip-tag: true
133           wipe-workspace: true
134           submodule:
135             disable: true
136             recursive: false
137             timeout: '{submodule-timeout}'
138           choosing-strategy: default
139
140     builders:
141       - description-setter:
142           description: "POD: $NODE_NAME"
143       - conditional-step:
144           condition-kind: regex-match
145           regex: 'compass'
146           label: '{installer}'
147           steps:
148             - shell:
149                 !include-raw-escape: ../iec/iec-compass-build.sh
150             - shell:
151                 !include-raw-escape: ../iec/iec-compass-deploy.sh
152             - shell:
153                 !include-raw-escape: ../iec/iec-fdn-install.sh
154       - conditional-step:
155           condition-kind: regex-match
156           regex: 'fuel'
157           label: '{installer}'
158           steps:
159             - shell:
160                 !include-raw-escape: ../iec/iec-fuel-deploy.sh
161
162     publishers: &publishers
163       - email:
164           recipients: armband@enea.com
165       - lf-infra-publish
166
167 - job-template:
168     id: akraino-iec-destroy
169     name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
170     concurrent: true
171     node: '{slave-label}'
172     properties: *properties
173     parameters:
174       - lf-infra-parameters:
175           project: '{project}'
176           stream: '{stream}'
177           branch: '{branch}'
178       - '{project}-defaults'
179       - '{installer}-{os}-defaults'
180       - string:
181           name: DEPLOY_SCENARIO
182           default: '{scenario}'
183       - string:
184           name: IEC_TYPE
185           default: '{iecType}'
186       - string:
187           name: EXTRA_ARGS
188           default: '-EEE -o {os}'
189
190     wrappers: *wrappers
191     scm: *scm
192
193     builders:
194       - description-setter:
195           description: "POD: $NODE_NAME"
196       - shell:
197           !include-raw-escape: ../iec/iec-{installer}-destroy.sh
198
199     publishers: *publishers
200
201 - job-template:
202     id: akraino-iec-phase-usecase
203     name: 'iec-{iecType}-{phase}-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
204     concurrent: true
205     node: '{slave-label}'
206     properties: *properties
207
208     parameters:
209       - lf-infra-parameters:
210           project: '{project}'
211           stream: '{stream}'
212           branch: '{branch}'
213       - '{project}-defaults'
214       - '{installer}-{os}-defaults'
215       - '{usecase}-defaults'
216
217     wrappers:
218       - build-name:
219           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
220
221     scm: *scm
222
223     builders:
224       - shell:
225           !include-raw-escape: ../iec/iec-{usecase}.sh
226
227     publishers: *publishers