blob: 8a03d7160ad1823b798db7a1d0c46b96834cda40 [file] [log] [blame]
Kailash Khalasi479a9472018-11-12 13:39:13 -08001// Copyright 2017-present Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15node ("${TestNodeName}") {
16 timeout (100) {
17 stage ("Parse deployment configuration file") {
18 sh returnStdout: true, script: "rm -rf ${configBaseDir}"
19 sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}"
20 deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
21 }
22 stage('Restart Fabric Switch processes') {
23 for(int i=0; i < deployment_config.fabric_switches.size(); i++) {
24 timeout(5) {
25 sh returnStdout: true, script: """
26 ssh-keyscan -H ${deployment_config.fabric_switches[i].ip} >> ~/.ssh/known_hosts
27 sshpass -p ${deployment_config.fabric_switches[i].pass} ssh -l ${deployment_config.fabric_switches[i].user} ${deployment_config.fabric_switches[i].ip} 'service ofagentd restart' || true
28 """
29 }
30 }
31 }
32 }
33}
34