| // Copyright 2017-present Open Networking Foundation |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| node ("${TestNodeName}") { |
| timeout (100) { |
| stage ("Parse deployment configuration file") { |
| sh returnStdout: true, script: "rm -rf ${configBaseDir}" |
| sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
| deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml" |
| } |
| stage('Restart Fabric Switch processes') { |
| for(int i=0; i < deployment_config.fabric_switches.size(); i++) { |
| timeout(5) { |
| sh returnStdout: true, script: """ |
| ssh-keyscan -H ${deployment_config.fabric_switches[i].ip} >> ~/.ssh/known_hosts |
| 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 |
| """ |
| } |
| } |
| } |
| } |
| } |
| |