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