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