build/ci: attempt to prevent Jenkins from killing Bazel

Every so often in CI we see the following:

   Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/home/ci/.cache/bazel/_bazel_ci/8746318cfadba75371ec634ee6e84c81/server/jvm.out')

Not sure what causes it, but setting this magical value apparently
causes Jenkins' ProcessTreeKiller to stop killing all subprocesses of an
existing process, which might be causing the above. We'll find out.

Change-Id: Ibe48126dcf547735183c8789260bac6c42a0a10e
Reviewed-on: https://review.monogon.dev/c/monogon/+/347
Reviewed-by: Leopold Schabel <leo@nexantic.com>
diff --git a/build/ci/jenkins-presubmit.groovy b/build/ci/jenkins-presubmit.groovy
index 75c0575..dc4a5cf 100644
--- a/build/ci/jenkins-presubmit.groovy
+++ b/build/ci/jenkins-presubmit.groovy
@@ -20,8 +20,8 @@
                     steps {
                         gerritCheck checks: ['jenkins:test': 'RUNNING'], message: "Running on ${env.NODE_NAME}"
                         sh "git clean -fdx -e '/bazel-*'"
-                        sh "bazel test //..."
-                        sh "bazel test -c dbg //..."
+                        sh "JENKINS_NODE_COOKIE=dontKillMe bazel test //..."
+                        sh "JENKINS_NODE_COOKIE=dontKillMe bazel test -c dbg //..."
                     }
                     post {
                         success {
@@ -43,8 +43,8 @@
                     steps {
                         gerritCheck checks: ['jenkins:gazelle': 'RUNNING'], message: "Running on ${env.NODE_NAME}"
                         sh "git clean -fdx -e '/bazel-*'"
-                        sh "bazel run //:fietsje"
-                        sh "bazel run //:gazelle -- update"
+                        sh "JENKINS_NODE_COOKIE=dontKillMe bazel run //:fietsje"
+                        sh "JENKINS_NODE_COOKIE=dontKillMe bazel run //:gazelle -- update"
 
                         script {
                             def diff = sh script: "git status --porcelain", returnStdout: true