[VOL-3580] Build script changes in master, for BAL installs for in-band config
Change-Id: If08ba4e5e368280761c0b60fec83f585fa5d2348
diff --git a/Jenkinsfile-voltha-build b/Jenkinsfile-voltha-build
index 4727faf..61e9f44 100644
--- a/Jenkinsfile-voltha-build
+++ b/Jenkinsfile-voltha-build
@@ -155,6 +155,7 @@
kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.imageID}{'\\n'}" | sort | uniq
kubectl get nodes -o wide
kubectl get pods -n voltha -o wide
+ kubectl get pods
"""
}
}
@@ -227,58 +228,6 @@
return sadis_out == 0
}
}
- if ( params.reinstallOlt ) {
- stage('Reinstall OLT software') {
- for(int i=0; i < deployment_config.olts.size(); i++) {
- sh returnStdout: true, script: """
- if [ "${branch}" != "master" ]; then
- sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${deployment_config.olts[i].oltDebVersion23}"
- else
- sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${deployment_config.olts[i].oltDebVersion}"
- fi
- sleep 10
- """
- timeout(5) {
- waitUntil {
- olt_sw_present = sh returnStdout: true, script: """
- if [ "${deployment_config.olts[i].oltDebVersion}" == *"asfvolt16"* ]; then
- sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l'
- else
- sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asgvolt64 | wc -l'
- fi
- if (${deployment_config.olts[i].fortygig}); then
- sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'echo "port ce128 sp=40000 if=XLAUI" >> /broadcom/qax.soc'
- fi
- """
- return olt_sw_present.toInteger() > 0
- }
- }
- }
- }
- stage('Restart OLT processes') {
- for(int i=0; i < deployment_config.olts.size(); i++) {
- timeout(5) {
- sh returnStdout: true, script: """
- ssh-keyscan -H ${deployment_config.olts[i].ip} >> ~/.ssh/known_hosts
- sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'rm -f /var/log/openolt.log; rm -f /var/log/dev_mgmt_daemon.log; rm -f /var/log/openolt_process_watchdog.log; reboot' || true
- sleep 120
- """
- }
- timeout(15) {
- waitUntil {
- devprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'ps -ef | grep dev_mgmt_daemon | wc -l'"
- return devprocess.toInteger() > 0
- }
- }
- timeout(15) {
- waitUntil {
- openoltprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'ps -ef | grep openolt | wc -l'"
- return openoltprocess.toInteger() > 0
- }
- }
- }
- }
- }
if ( deployment_config.fabric_switches.size() > 0 ) {
stage('Switch Configurations in ONOS') {
timeout(1) {
@@ -333,7 +282,81 @@
}
}
}
- if ( params.inBandManagement ) {
+ if ( params.reinstallOlt ) {
+ stage('Reinstall OLT software') {
+ for(int i=0; i < deployment_config.olts.size(); i++) {
+ sh returnStdout: true, script: """
+ if [[ "${branch}" != "master" ]] && [[ "${params.inBandManagement}" == "true" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'kill -9 `pgrep -f "[b]ash /opt/openolt/openolt_dev_mgmt_daemon_process_watchdog"` || true'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion23}"
+ fi
+ if [[ "${branch}" != "master" ]] && [[ "${params.inBandManagement}" == "false" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion23}"
+ fi
+ if [[ "${branch}" == "master" ]] && [[ "${params.inBandManagement}" == "true" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'kill -9 `pgrep -f "bash /opt/openolt/openolt_dev_mgmt_daemon_process_watchdog"` || true'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion}"
+ fi
+ if [[ "${branch}" == "master" ]] && [[ "${params.inBandManagement}" == "false" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion}"
+ fi
+ sleep 10
+ """
+ timeout(5) {
+ waitUntil {
+ olt_sw_present = sh returnStdout: true, script: """
+ if [ "${deployment_config.olts[i].oltDebVersion}" == *"asfvolt16"* ]; then
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'dpkg --list | grep asfvolt16 | wc -l'
+ else
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'dpkg --list | grep asgvolt64 | wc -l'
+ fi
+ if (${deployment_config.olts[i].fortygig}); then
+ if [[ "${params.inBandManagement}" == "true" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'mkdir -p /opt/openolt/'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'cp /root/watchdog-script/* /opt/openolt/'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'cp /root/bal_cli_appl/example_user_appl /broadcom'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'cp in-band-startup-script/* /etc/init.d/'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'echo "port ce128 sp=40000 if=XLAUI" >> /broadcom/qax.soc'
+ else
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'echo "port ce128 sp=40000 if=XLAUI" >> /broadcom/qax.soc'
+ fi
+ fi
+ """
+ return olt_sw_present.toInteger() > 0
+ }
+ }
+ }
+ }
+ stage('Restart OLT processes') {
+ for(int i=0; i < deployment_config.olts.size(); i++) {
+ timeout(15) {
+ sh returnStdout: true, script: """
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'rm -f /var/log/openolt.log; rm -f /var/log/dev_mgmt_daemon.log; rm -f /var/log/openolt_process_watchdog.log; reboot' || true
+ sleep 360
+ """
+ }
+ timeout(15) {
+ waitUntil {
+ devprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'ps -ef | grep dev_mgmt_daemon | wc -l'"
+ return devprocess.toInteger() > 0
+ }
+ }
+ timeout(15) {
+ waitUntil {
+ openoltprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'ps -ef | grep openolt | wc -l'"
+ return openoltprocess.toInteger() > 0
+ }
+ }
+ }
+ }
+ }
+ /*if ( params.inBandManagement ) {
stage('Reboot OLT') {
for(int i=0; i < deployment_config.olts.size(); i++) {
timeout(10) {
@@ -357,7 +380,7 @@
}
}
}
- }
+ }*/
currentBuild.result = 'SUCCESS'
} catch (err) {