Avoid failure in case no port-forwards are present.
Without || true the result will be
ps aux
grep port-forw
grep -v grep
awk '{print $2}'
xargs --no-run-if-empty kill -9
kill: (15338): No such process
and the pipeline will forcefully stop.
Change-Id: I0b377e406567dc2dc154eed21216aa5b3f1ca8b1
diff --git a/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy b/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy
index 4536656..fb5e75c 100644
--- a/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy
+++ b/jjb/pipeline/voltha/master/voltha-scale-multi-stack.groovy
@@ -55,7 +55,7 @@
timeout(time: 11, unit: 'MINUTES') {
sh """
# remove orphaned port-forward from different namespaces
- ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9
+ ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
"""
script {
def namespaces = ["infra"]
@@ -71,7 +71,7 @@
helm repo update
# remove all port-forward from different namespaces
- ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9
+ ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
"""
}
}
@@ -347,7 +347,7 @@
printf '%s\n' \$(voltctl -m 8MB logicaldevice list -q) | xargs --no-run-if-empty -I# bash -c "voltctl -m 8MB logicaldevice port list # > $LOG_FOLDER/${stack_ns}/voltha-logicaldevice-ports-#.txt" || true
# remove VOLTHA port-forward
- ps aux | grep port-forw | grep voltha-api | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9
+ ps aux | grep port-forw | grep voltha-api | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
"""
} catch(e) {
sh '''
@@ -455,7 +455,7 @@
"""
sh """
# remove VOLTHA port-forward
- ps aux | grep port-forw | grep voltha-api | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 2>&1 > /dev/null
+ ps aux | grep port-forw | grep voltha-api | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 2>&1 > /dev/null || true
"""
}
}