Added script installKind to fix the chicken-n-egg problem around cluster detection. Wrap call in a try/catch block until build system behavior is known
Change-Id: I874e841e6076e9f59c16213f575b14f7023388ab
diff --git a/jjb/pipeline/voltha/master/bbsim-tests.groovy b/jjb/pipeline/voltha/master/bbsim-tests.groovy
index 6a2330f..a41060f 100644
--- a/jjb/pipeline/voltha/master/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/master/bbsim-tests.groovy
@@ -282,18 +282,39 @@
buildVolthaComponent("${gerritProject}")
}
}
- stage('Create K8s Cluster') {
- steps {
- script {
- def clusterExists = sh returnStdout: true, script: """
+
+ stage('Create K8s Cluster')
+ {
+ steps
+ {
+ script
+ {
+ // non-fatal prototyping
+ try
+ {
+ installKind(self) { debug:true }
+ }
+ catch (Exception err)
+ {
+ println("** ${iam}: EXCEPTION ${err}")
+ throw err
+ }
+ finally
+ {
+ println("** ${iam}: LEAVE")
+ }
+
+ def clusterExists = sh returnStdout: true, script: """
kind get clusters | grep ${clusterName} | wc -l
"""
- if (clusterExists.trim() == "0") {
- createKubernetesCluster([nodes: 3, name: clusterName])
- }
+ if (clusterExists.trim() == "0")
+ {
+ createKubernetesCluster([nodes: 3, name: clusterName])
+ }
+ }
}
- }
}
+
stage('Replace voltctl') {
// if the project is voltctl override the downloaded one with the built one
when {
@@ -357,3 +378,5 @@
}
}
}
+
+// EOF