archiving kube pod logs during post execution
Change-Id: I699ed6ad1687d7b72e70f5c6c0b16fe291ce36ed
diff --git a/jjb/pipeline/xos-synchronizer-update.groovy b/jjb/pipeline/xos-synchronizer-update.groovy
index da4c4c7..4a3d5e8 100644
--- a/jjb/pipeline/xos-synchronizer-update.groovy
+++ b/jjb/pipeline/xos-synchronizer-update.groovy
@@ -387,6 +387,11 @@
post {
always {
sh '''
+ for pod in \$(kubectl get pods --no-headers | awk '{print \$1}');
+ do
+ kubectl logs \$pod > $WORKSPACE/\$pod.log;
+ done
+
kubectl get pods --all-namespaces
echo "# removing helm deployments"
@@ -401,6 +406,7 @@
sudo minikube delete
'''
+ archiveArtifacts artifacts: '*.log'
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "suchitra@opennetworking.org, you@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false])
}
}