Various fixes on the pipeline

- Fix a syntax error. Maybe we could detect them with a build test but
  we need to figure out how to ship Jenkins dependencies on the class path.
- Nit: arranged the formatting of BazelUtils
- Nit: remove duplicate null affectation
- Fix the path to bazel, on freebsd it is a symlink from
  ~/.bazel/latest/binary/bazel and ~/.bazel/latest/bin/bazel does not exists
- Applies the -with{,out}-jdk patch to the bootstrap groovy.

With all those fixes here what is not yet working on the global pipeline:
  - Windows MSYS fails because it expects a cpu that is in 0.5.0
  - Windows MSVC fails because it expects a path that will be there after 0.5.0

So waiting for tomorrow's release and will continue to debug the pipeline.

Change-Id: Iec63cad686d28b93ff127d6bb1e7b1c4cd730f21
diff --git a/jenkins/jobs/configs/bootstrap.json b/jenkins/jobs/configs/bootstrap.json
index 7eb338e..751a814 100644
--- a/jenkins/jobs/configs/bootstrap.json
+++ b/jenkins/jobs/configs/bootstrap.json
@@ -11,7 +11,8 @@
         "parameters": {
             "archive": {
                 "bazel-bin/src/bazel": "bazel",
-                "bazel-bin/scripts/packages/install.sh": "bazel-%{release_name}-installer.sh",
+                "bazel-bin/scripts/packages/with-jdk/install.sh": "bazel-%{release_name}-installer.sh",
+                "bazel-bin/scripts/packages/without-jdk/install.sh": "bazel-%{release_name}-without-jdk-installer.sh",
                 "bazel-bin/scripts/packages/debian/bazel-debian.deb": "bazel_%{release_name}.deb",
                 "bazel-genfiles/bazel-distfile.zip": "bazel-%{release_name}-dist.zip"
             },
@@ -46,7 +47,8 @@
         "parameters": {
             "archive": {
                 "bazel-bin/src/bazel": "bazel",
-                "bazel-bin/scripts/packages/install.sh": "bazel-%{release_name}-installer.sh"
+                "bazel-bin/scripts/packages/with-jdk/install.sh": "bazel-%{release_name}-installer.sh",
+                "bazel-bin/scripts/packages/without-jdk/install.sh": "bazel-%{release_name}-installer.sh"
             },
             "targets": [
                 "//scripts/packages"
@@ -90,7 +92,7 @@
         "parameters": {
             "archive": {
                 "bazel-bin/src/bazel": "bazel",
-                "bazel-bin/scripts/packages/install.sh": "bazel-%{release_name}-installer.sh",
+                "bazel-bin/scripts/packages/without-jdk/install.sh": "bazel-%{release_name}-installer.sh",
                 "bazel-bin/scripts/packages/debian/bazel-debian.deb": "bazel_%{release_name}.deb"
             },
             "stash": {
@@ -112,7 +114,7 @@
         "parameters": {
             "archive": {
                 "bazel-bin/src/bazel": "bazel",
-                "bazel-bin/scripts/packages/install.sh": "bazel-%{release_name}-installer.sh"
+                "bazel-bin/scripts/packages/without-jdk/install.sh": "bazel-%{release_name}-installer.sh"
             },
             "targets": [
                 "//scripts/packages"
diff --git a/jenkins/lib/src/build/bazel/ci/BazelUtils.groovy b/jenkins/lib/src/build/bazel/ci/BazelUtils.groovy
index ccac346..e7d1fe9 100644
--- a/jenkins/lib/src/build/bazel/ci/BazelUtils.groovy
+++ b/jenkins/lib/src/build/bazel/ci/BazelUtils.groovy
@@ -28,9 +28,11 @@
   def setBazel(value) {
     bazel = value
   }
+
   def getBazel() {
     bazel
   }
+
   def setScript(value) {
     script = value
     ws = script.pwd()
@@ -41,10 +43,13 @@
       envs = ["BAZEL_SH=${bazel_sh}"]
     }
   }
+
   def getScript() {
     script
   }
 
+  // Actual method
+
   private def execute(script, returnStatus = false, returnStdout = false) {
     if (isWindows) {
       return this.script.bat(script: script, returnStatus: returnStatus, returnStdout: returnStdout)
@@ -62,7 +67,6 @@
     }
   }
 
-  // Actual method
 
   // Write a RC file to consume by the other step
   def writeRc(build_opts = [],
diff --git a/jenkins/lib/vars/bazelPath.groovy b/jenkins/lib/vars/bazelPath.groovy
index d41a8c1..b1fe613 100644
--- a/jenkins/lib/vars/bazelPath.groovy
+++ b/jenkins/lib/vars/bazelPath.groovy
@@ -50,7 +50,7 @@
   } else {
     def bazel = node_label.startsWith("windows") ?
                 "c:\\bazel_ci\\installs\\${bazel_version}\\bazel.exe" :
-                "${env.HOME}/.bazel/${bazel_version}/bin/bazel"
+                "${env.HOME}/.bazel/${bazel_version}/binary/bazel"
     echo "Using released version of Bazel at ${bazel}"
     return bazel
   }
diff --git a/jenkins/lib/vars/bootstrapBazel.groovy b/jenkins/lib/vars/bootstrapBazel.groovy
index eefcb10..d491821 100644
--- a/jenkins/lib/vars/bootstrapBazel.groovy
+++ b/jenkins/lib/vars/bootstrapBazel.groovy
@@ -31,7 +31,6 @@
   def branch = config.get("branch", "master")
   def refspec = config.get("refspec", "+refs/heads/*:refs/remotes/origin/*")
   def targets = config.get("targets", [])
-  def opts = config.get("opts", [])
 
   node(config.node) {
     def utils = new BazelUtils()
diff --git a/jenkins/lib/vars/bootstrapBazelAll.groovy b/jenkins/lib/vars/bootstrapBazelAll.groovy
index 066f05c..64135c3 100644
--- a/jenkins/lib/vars/bootstrapBazelAll.groovy
+++ b/jenkins/lib/vars/bootstrapBazelAll.groovy
@@ -56,9 +56,6 @@
     }
   }
 
-  // Avoid serialization
-  entrySet = null
-
   // The actual job
   parallel jobs
 }