df14cbe4fa0f029c26d6ea123c16baa6cf3a3f05
[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 }}-{{ 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: '$GERRIT_REFSPEC'
128           branches: '$GERRIT_BRANCH'
129           skip-tag: true
130           wipe-workspace: true
131           submodule:
132             disable: true
133             recursive: false
134             timeout: '{submodule-timeout}'
135           choosing-strategy: default
136
137     builders:
138       - description-setter:
139           description: "POD: $NODE_NAME"
140       - conditional-step:
141           condition-kind: regex-match
142           regex: 'compass'
143           label: '{installer}'
144           steps:
145             - shell:
146                 !include-raw-escape: ../iec/iec-compass-build.sh
147             - shell:
148                 !include-raw-escape: ../iec/iec-compass-deploy.sh
149             - shell:
150                 !include-raw-escape: ../iec/iec-fdn-install.sh
151       - conditional-step:
152           condition-kind: regex-match
153           regex: 'fuel'
154           label: '{installer}'
155           steps:
156             - shell:
157                 !include-raw-escape: ../iec/iec-fuel-deploy.sh
158
159     publishers: &publishers
160       - email:
161           recipients: armband@enea.com
162       - lf-infra-publish
163
164 - job-template:
165     id: akraino-iec-destroy
166     name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
167     concurrent: true
168     node: '{slave-label}'
169     properties: *properties
170     parameters:
171       - lf-infra-parameters:
172           project: '{project}'
173           stream: '{stream}'
174           branch: '{branch}'
175       - '{project}-defaults'
176       - '{installer}-{os}-defaults'
177       - string:
178           name: DEPLOY_SCENARIO
179           default: '{scenario}'
180       - string:
181           name: IEC_TYPE
182           default: '{iecType}'
183       - string:
184           name: EXTRA_ARGS
185           default: '-EEE -o {os}'
186
187     wrappers: *wrappers
188     scm: *scm
189
190     builders:
191       - description-setter:
192           description: "POD: $NODE_NAME"
193       - shell:
194           !include-raw-escape: ../iec/iec-{installer}-destroy.sh
195
196     publishers: *publishers
197
198 - job-template:
199     id: akraino-iec-install-usecase
200     name: 'iec-{iecType}-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
201     concurrent: true
202     node: '{slave-label}'
203     properties: *properties
204
205     parameters:
206       - lf-infra-parameters:
207           project: '{project}'
208           stream: '{stream}'
209           branch: '{branch}'
210       - '{project}-defaults'
211       - '{installer}-{os}-defaults'
212
213     wrappers:
214       - build-name:
215           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
216
217     scm: *scm
218
219     builders:
220       - shell:
221           !include-raw-escape: ../iec/iec-{usecase}.sh
222
223     publishers: *publishers
224