Remove support for local testing via Docker

Change-Id: Ib0ff5326a9a053a6fb6ceebfc6d682c0614379d6
diff --git a/WORKSPACE b/WORKSPACE
index 9af6cc6..1718e71 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -29,10 +29,6 @@
 # "repositories" function(s).
 container_repositories()
 
-# For testing with docker
-load("//jenkins/test:docker_repository.bzl", "docker_repository")
-docker_repository()
-
 # Docker base images
 load("//base:docker_base.bzl", "docker_bases")
 docker_bases()
diff --git a/docs/init.md b/docs/init.md
index 16d9d04..52fe3eb 100644
--- a/docs/init.md
+++ b/docs/init.md
@@ -77,38 +77,26 @@
 
     To regenerate:
 
-    1.  Run the local, testing instance of Jenkins:
-
-        ```sh
-        bazel run //jenkins/test [-- -p <port>]
-        ```
-
-        This deploys some Docker images on your local machine and starts a
-        testing Jenkins instance, by default on port 8080.
-
-    2.  Wait for the server to start on `localhost:8080`
-    3.  Click "Manage Jenkins" > "Manage Credentials".
-    4.  Enter the password for the GitHub account
-    5.  Click on "Save".
+    1.  Click "Manage Jenkins" > "Manage Credentials".
+    2.  Enter the password for the GitHub account
+    3.  Click on "Save".
 
         This updates `/var/jenkins_home/credentials.xml` inside
         the local Docker container with the secret.
 
-    6.  Find the container's ID and open an interactive terminal in it:
+    4.  Connect to the Jenkins VM:
 
         ```sh
-        docker ps | grep "jenkins-test"
-        docker exec -t -i <container ID> bash
+        gcloud compute ssh jenkins
         ```
 
-    7.  In the interactive terminal, grep the transformed password:
+    5.  Copy the credentials out of the file:
 
         ```sh
-        # inside jenkins@<container ID>
-        cat /var/jenkins_home/credentials.xml | grep password
+        cat /volumes/jenkins_home/credentials.xml
         ```
 
-    8.  Copy the value of the `<password>` tag and write it to
+    6.  Copy the value of the `<password>` tag and write it to
         `/volumes/secrets/github.bazel-io.jenkins.password`.
 
 *   `boto_config`: a boto config file with oauth token to access GCS
diff --git a/docs/workflow.md b/docs/workflow.md
index d81100e..5ab0dd1 100644
--- a/docs/workflow.md
+++ b/docs/workflow.md
@@ -27,52 +27,8 @@
 The process typically looks like:
 
 1.  Make your change.
-2.  Deploy to production with `bazel run //gcr:deploy`.
+2.  Deploy to Google Cloud with `bazel run //gcr:deploy`.
 3.  Gracefully restart the Jenkins instance: https://ci.bazel.build/safeExit
 
     If Jenkins doesn't exit fast enough, ensure that no important jobs are
     running and then: https://ci.bazel.build/exit
-
-## Setting up local testing
-
-You can run a local Jenkins instance with a Docker executor node, by running:
-
-```
-bazel run //jenkins/test [-- -p port]
-```
-
-It will spin up a Jenkins instance:
-
-*   without security
-*   on port `port` (8080 by default)
-*   with one node running Ubuntu Wily in Docker
-
-This setup should suffice for local testing.
-
-To stop the instance, go to `http://localhost:8080/exit`. This will shut
-down Jenkins cleanly.
-
-You can connect additional instance by modifying the UI to test for other
-platforms. However this does not enable to test:
-
-*   Synchronization between Gerrit and Github
-*   Adding execution nodes
-*   Interaction with Github or Gerrit
-
-## Faster testing cycle
-
-If you only need to modify Groovy code under `jenkins/lib`, you can update that
-in the running container without restarting Jenkins.
-
-1.  Start the container:
-
-    ```
-    bazel run //jenkins/test
-    ```
-
-2.  Make your changes to `.groovy` files.
-3.  Transfer the `lib` folder to the running container:
-
-    ```
-    jenkins/transfer-lib.sh
-    ```
diff --git a/jenkins/BUILD b/jenkins/BUILD
index c5e639d..b8f1223 100644
--- a/jenkins/BUILD
+++ b/jenkins/BUILD
@@ -142,14 +142,6 @@
     tunnel = "jenkins.c.bazel-public.internal:50000",
 )
 
-docker_build(
-    name = "ubuntu-with-bazel-installer",
-    base = "//base:ubuntu-xenial-amd64-deploy",
-    data_path = "/gce",
-    directory = "/opt/run",
-    files = ["//gce:bootstrap-bazel.sh"],
-)
-
 # Jenkins job for Gerrit vetting
 jenkins_job(
     name = "maintenance/gerrit-verifier",
@@ -249,35 +241,6 @@
     visibility = ["//visibility:public"],
 )
 
-# The Jenkins node used for testing on localhost via //jenkins/test.
-jenkins_node(
-    name = "ubuntu-docker",
-    docker_base = ":ubuntu-with-bazel-installer",
-    labels = [
-        "linux-x86_64",
-        "install-bazel",
-    ],
-)
-
-# The Jenkins image used for testing on localhost via //jenkins/test.
-jenkins_docker_build(
-    name = "jenkins-test",
-    configs = [
-        ":config_xml-nosecurity",
-        ":deploy",
-        ":jenkins-common-configs",
-        ":ubuntu-docker",
-    ],
-    jobs = [
-        "//jenkins/jobs:test-jobs",
-        ":maintenance/gerrit-verifier/test",
-    ],
-    substitutions = {
-        "PUBLIC_JENKINS_URL": "##ENV:JENKINS_SERVER##",
-    },
-    tars = ["//jenkins/lib"],
-)
-
 expand_template(
     name = "config_xml",
     out = "config/config.xml",
diff --git a/jenkins/base/jenkins_base.bzl b/jenkins/base/jenkins_base.bzl
index 6b45aa2..35aed52 100644
--- a/jenkins/base/jenkins_base.bzl
+++ b/jenkins/base/jenkins_base.bzl
@@ -23,7 +23,7 @@
 load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
 pkg_tar(
     name = "plugins",
-    files = glob(["**/*.jpi"]),
+    srcs = glob(["**/*.jpi"]),
     mode = "0644",
     strip_prefix = ".",
     package_dir = "/usr/share/jenkins/ref/plugins",
diff --git a/jenkins/build_defs/jenkins_docker_build.bzl b/jenkins/build_defs/jenkins_docker_build.bzl
index 2d3a892..c13788f 100644
--- a/jenkins/build_defs/jenkins_docker_build.bzl
+++ b/jenkins/build_defs/jenkins_docker_build.bzl
@@ -15,7 +15,7 @@
 # Creation of the docker container for the jenkins master.
 
 load("@io_bazel_rules_docker//docker:docker.bzl", "docker_build")
-load(":templates.bzl", "merge_files", "strip_suffix")
+load(":templates.bzl", "merge_files")
 load(":vars.bzl", "MAIL_SUBSTITUTIONS")
 
 def _build_jobs_impl(ctx):
@@ -26,17 +26,16 @@
     "--mode=0644",
     "--directory=/usr/share/jenkins/ref/jobs",
     ]
-  suffixes = ctx.attr.strip_suffixes
   # Group fob by folders
   for f in ctx.files.jobs:
     if f.owner and "/" in f.owner.name:
       segments = f.owner.name.split("/")
       for i in range(1, len(segments)):
         folders_to_create["/jobs/".join(segments[:i])] = True
-      p = strip_suffix(f.owner.name.replace("/", "/jobs/"), suffixes)
+      p = f.owner.name.replace("/", "/jobs/")
       args.append("--file=%s=%s/config.xml" % (f.path, p))
     else:
-      p = strip_suffix(f.basename[:-len(f.extension)-1], suffixes)
+      p = f.basename[:-len(f.extension)-1]
       args.append("--file=%s=%s/config.xml" % (f.path, p))
 
   for folder in folders_to_create:
@@ -53,7 +52,6 @@
 _build_jobs = rule(
     attrs = {
         "jobs": attr.label_list(allow_files=True),
-        "strip_suffixes": attr.string_list(default=["-test"]),
         "_folder_xml": attr.label(
             default=Label("//jenkins/build_defs:folder.xml"),
             allow_files=True,
diff --git a/jenkins/build_defs/jenkins_job.bzl b/jenkins/build_defs/jenkins_job.bzl
index ee4c948..5557e01 100644
--- a/jenkins/build_defs/jenkins_job.bzl
+++ b/jenkins/build_defs/jenkins_job.bzl
@@ -22,8 +22,7 @@
 
 def jenkins_job(name, config, substitutions = {}, deps = [], deps_aliases = {},
                 project='bazel', org='bazelbuild', git_url=None, project_url=None,
-                folder=None, test_platforms=["linux-x86_64"],
-                create_filegroups=True):
+                folder=None, create_filegroups=True):
   """Create a job configuration on Jenkins.
 
   Args:
@@ -35,8 +34,6 @@
      org: the project organization on github, default 'bazelbuild'
      git_url: the URL to the git project, defaulted to the Github URL
      project_url: the project url, defaulted to the Git URL
-     test_platforms: platforms on which to run that job when inside of a
-       dockerized test, by default only 'linux-x86_64'
      create_filegroups: create filegroups named <name>/all and <name>/test that
        contain the files that have to be included to include that job. This is
        to be set to false if the calling macros already creates those
@@ -72,19 +69,6 @@
   if create_filegroups:
     native.filegroup(name = name + "/all", srcs = [name])
 
-  if test_platforms:
-    substitutions["RESTRICT_CONFIGURATION"] += " + [node:%s]" % _to_groovy_list(test_platforms)
-    expand_template(
-      name = name + "-test",
-      template = config,
-      out = "%s-test.xml" % name,
-      deps = deps,
-      deps_aliases = deps_aliases,
-      substitutions = substitutions,
-    )
-    if create_filegroups:
-      native.filegroup(name = name + "/test", srcs = [name + "-test"])
-
 def bazel_git_job(**kwargs):
   """Override bazel_github_job to test a project that is not on GitHub."""
   kwargs["github_enabled"] = False
@@ -97,7 +81,6 @@
 def bazel_github_job(name, branch="master", project=None, org="bazelbuild",
                      project_url=None, workspace=".", git_url=None,
                      config="//jenkins/build_defs:default.json",
-                     test_platforms=["linux-x86_64"],
                      enable_trigger=True,
                      poll=None,
                      gerrit_project=None,
@@ -129,7 +112,6 @@
   }
 
   all_files = [name + ".xml"]
-  test_files = [name + "-test.xml"]
 
   kwargs = {}
   if not github_enabled:
@@ -145,7 +127,6 @@
       project=project,
       org=org,
       project_url=project_url,
-      test_platforms=test_platforms,
       create_filegroups=False,
       **kwargs)
 
@@ -161,10 +142,8 @@
         project=project,
         org=org,
         project_url=project_url,
-        test_platforms=test_platforms,
         create_filegroups=False)
     all_files.append("Global/%s.xml" % name)
-    test_files.append("Global/%s-test.xml" % name)
 
   if pr_enabled and config:
     jenkins_job(
@@ -177,10 +156,8 @@
         project=project,
         org=org,
         project_url=project_url,
-        test_platforms=test_platforms,
         create_filegroups=False)
     all_files.append("PR/%s.xml" % name)
-    test_files.append("PR/%s-test.xml" % name)
 
   if gerrit_project:
     jenkins_job(
@@ -192,11 +169,7 @@
         substitutions=substitutions,
         project=project,
         org=org,
-        project_url=project_url,
-        test_platforms=test_platforms)
+        project_url=project_url)
     all_files.append("CR/%s.xml" % name)
-    test_files.append("CR/%s-test.xml" % name)
 
   native.filegroup(name = "%s/all" % name, srcs = all_files)
-  if test_platforms:
-    native.filegroup(name = "%s/test" % name, srcs = test_files)
diff --git a/jenkins/build_defs/templates.bzl b/jenkins/build_defs/templates.bzl
index 43d151a..42b4b5c 100644
--- a/jenkins/build_defs/templates.bzl
+++ b/jenkins/build_defs/templates.bzl
@@ -82,15 +82,9 @@
       return path[len(prefix):]
   return path
 
-def strip_suffix(path, suffixes):
-  for suffix in suffixes:
-    if path.endswith(suffix):
-      return path[:-len(suffix)]
-  return path
-
-def _dest_path(f, strip_prefixes, strip_suffixes):
-  """Returns the short path of f, stripped of strip_prefixes and strip_suffixes."""
-  return strip_suffix(strip_prefix(f.short_path, strip_prefixes), strip_suffixes)
+def _dest_path(f, strip_prefixes):
+  """Returns the short path of f, stripped of strip_prefixes."""
+  return strip_prefix(f.short_path, strip_prefixes)
 
 def _format_path(path_format, path):
   dirsep = path.rfind("/")
@@ -128,7 +122,7 @@
       for k in ctx.attr.substitutions
   ]
   for f in ctx.files.srcs:
-    path = _dest_path(f, ctx.attr.strip_prefixes, ctx.attr.strip_suffixes)
+    path = _dest_path(f, ctx.attr.strip_prefixes)
     if path.endswith(ctx.attr.template_extension):
       path = path[:-4]
       f2 = ctx.new_file(ctx.label.name + "/" + path)
@@ -159,7 +153,6 @@
         "template_extension": attr.string(default=".tpl"),
         "directory": attr.string(default="/"),
         "strip_prefixes": attr.string_list(default=[]),
-        "strip_suffixes": attr.string_list(default=["-test"]),
         "substitutions": attr.string_dict(default={}),
         "path_format": attr.string(default="{path}"),
         "_build_tar": attr.label(
@@ -192,8 +185,6 @@
   directory: base directory for all the files in the resulting tarball.
   strip_prefixes: list of prefixes to strip from the path of the srcs to obtain
       the final path (see path_format).
-  strip_suffixes: list of suffixes to strip from the path of the srcs to obtain
-      the final path (see path_format).
   substitutions: map of substitutions to make available during template
       expansion. Values of that map will be available as "variables.name" in
       the template environment.
diff --git a/jenkins/test/BUILD b/jenkins/test/BUILD
deleted file mode 100644
index c83df10..0000000
--- a/jenkins/test/BUILD
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2017 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package(default_visibility = ["//jenkins:__subpackages__"])
-
-sh_library(
-    name = "common",
-    srcs = ["common.sh"],
-    data = [
-        "//jenkins:deploy.docker",
-        "//jenkins:jenkins-test",
-        "//jenkins:ubuntu-docker.docker",
-    ],
-)
-
-sh_binary(
-    name = "test",
-    srcs = ["test.sh"],
-    data = [
-        "//jenkins:deploy.docker",
-        "//jenkins:jenkins-test",
-        "//jenkins:ubuntu-docker.docker",
-    ],
-    deps = [":common"],
-)
-
-sh_library(
-    name = "test-support",
-    srcs = ["test-support.sh"],
-    deps = [":common"],
-)
-
-sh_test(
-    name = "test_url_answer",
-    size = "large",
-    srcs = ["test_url_answer.sh"],
-    # TODO(dmarting): why the sh_library data does not get shipped in the sh_test data?
-    data = [
-        "//jenkins:deploy.docker",
-        "//jenkins:jenkins-test",
-        "//jenkins:ubuntu-docker.docker",
-        "@docker//:docker",
-    ],
-    deps = [":test-support"],
-)
diff --git a/jenkins/test/common.sh b/jenkins/test/common.sh
deleted file mode 100755
index e78896e..0000000
--- a/jenkins/test/common.sh
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2016 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Runs the jenkins test images inside the docker container.
-# TODO(dmarting): should certainly centralize everything around docker testing
-# in the docker rules and replace that.
-
-: ${DOCKER:=docker}
-
-load_images() {
-  # Load all images.
-  "${PYTHON_RUNFILES}/io_bazel_ci/jenkins/ubuntu-docker.docker"
-  "${PYTHON_RUNFILES}/io_bazel_ci/jenkins/deploy.docker"
-  "${PYTHON_RUNFILES}/io_bazel_ci/jenkins/jenkins-test"
-}
-
-run_jenkins_master() {
-  # Run main container, serving jenkins on port provided by the first argument,
-  # defaulting to 8080.
-  local server="${1:-127.0.0.1}"
-  local port="${2:-8080}"
-  shift 2
-  ${DOCKER} run -d \
-	 --env JENKINS_SERVER="http://jenkins:${port}" \
-	 -p "${server}:${port}:8080" \
-	 "$@" \
-	 bazel/jenkins:jenkins-test
-}
-
-get_jenkins_port() {
-  # Return the port in which the jenkins master has been mapped to
-  ${DOCKER} port "$1" 8080 | cut -d ":" -f 2
-}
-
-# Wait for jenkins to start-up for at most 3 minutes
-wait_for_server() {
-  local server="${1:-localhost}"
-  local port="${2:-8080}"
-  local timeout=300
-  local ts="$(date +%s)"
-  echo -n "*** Waiting for jenkins server to be up and running on port ${port}"
-  while ! [[ "$(curl -sI  "http://${server}:${port}/jnlpJars/slave.jar")" =~ ^HTTP/[0-9.]+\ 2 ]]
-  do
-    echo -n "."
-    sleep 1
-    if (( "$(date +%s)" - "$ts" > "$timeout" )); then
-      echo
-      echo "Failed to connect to Jenkins, aborting..." >&2
-      return 1
-    fi
-  done
-  echo " ok."
-}
-
-run_containers() {
-  # Run the executor nodes, in priviledged mode for Bazel.
-  local jenkins="$1"
-  ${DOCKER} run -d --privileged=true \
-         --link "${jenkins}:jenkins" --env "JENKINS_SERVER=http://jenkins:8080" \
-         bazel/jenkins:ubuntu-docker.docker
-  ${DOCKER} run -d --privileged=true \
-         --link "${jenkins}:jenkins" --env "JENKINS_SERVER=http://jenkins:8080" \
-         bazel/jenkins:deploy.docker
-}
-
-kill_containers() {
-  # Kill containers and remove them
-  for i in "$@"; do
-    ${DOCKER} rm -f "$i" &>/dev/null || true
-  done
-}
-
-test_setup() {
-  # Setup the test and returns the list of started-up containers, the master first
-  local server="${1:-localhost}"
-  local port="${2:-0}"
-  shift 2
-  load_images >&2
-  local jenkins="$(run_jenkins_master "${server}" "${port}" "$@")"
-  port=$(get_jenkins_port "${jenkins}")
-  wait_for_server "${server}" "${port}" >&2 || {
-    echo "Docker logs:" >&2
-    ${DOCKER} logs "$jenkins"
-    ${DOCKER} rm -f "${jenkins}" >&2
-    exit 1
-  }
-  local containers="$(run_containers "${jenkins}" | xargs)"
-  echo "$jenkins $containers"
-}
-
-attach() {
-  # Attach to the first containers passed in argument
-  ${DOCKER} attach "$1"
-}
-
diff --git a/jenkins/test/docker_repository.bzl b/jenkins/test/docker_repository.bzl
deleted file mode 100644
index 4f96170..0000000
--- a/jenkins/test/docker_repository.bzl
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2016 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Rule for importing the docker binary for tests (experimental)."""
-
-def _impl(ctx):
-  docker = ctx.which("docker")
-  if docker == None:
-    # We cannot find docker, we won't be able to run tests depending
-    # on it, silently ignoring.
-    ctx.file("BUILD",
-             "\n".join([
-                 "filegroup(",
-                 "    name = 'docker',",
-                 "    visibility = ['//visibility:public'],",
-                 ")"
-                 ]))
-  else:
-    exports = []
-    for k in ctx.os.environ:
-      # DOCKER* environment variable are used by the docker client
-      # to know how to talk to the docker daemon.
-      if k.startswith("DOCKER"):
-        exports.append("export %s='%s'" % (k, ctx.os.environ[k]))
-    ctx.symlink(docker, "docker-bin")
-    ctx.file("docker.sh", "\n".join([
-        "#!/bin/bash",
-        "\n".join(exports),
-"""BIN="$0"
-while [ -L "${BIN}" ]; do
-  BIN="$(readlink "${BIN}")"
-done
-exec "${BIN%%.sh}-bin" "$@"
-"""]))
-    ctx.file("BUILD", "\n".join([
-        "sh_binary(",
-        "    name = 'docker',",
-        "    srcs = ['docker.sh'],",
-        "    data = [':docker-bin'],",
-        "    visibility = ['//visibility:public'],",
-        ")"]))
-
-docker_repository_ = repository_rule(_impl)
-
-def docker_repository():
-  """Declare a @docker repository that provide a docker binary."""
-  docker_repository_(name = "docker")
diff --git a/jenkins/test/test-support.sh b/jenkins/test/test-support.sh
deleted file mode 100644
index cd7c36a..0000000
--- a/jenkins/test/test-support.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2017 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Utilities to write integration test that run jenkins inside docker
-# and interrogate the jenkins master.
-
-DOCKER="${PYTHON_RUNFILES}/docker/docker"
-source "${PYTHON_RUNFILES}/io_bazel_ci/jenkins/test/common.sh"
-
-set -e
-
-# Machine on which the docker daemon is running, default is localhost.
-: ${DOCKER_SERVER:=127.0.0.1}
-
-setup() {
-  __test_support_containers="$(test_setup "${DOCKER_SERVER}" 0)"
-  __test_support_port=$(get_jenkins_port ${__test_support_containers})
-  __test_support_diagnostics=
-}
-
-teardown() {
-  local jenkins="$(f() { echo $1; }; f ${__test_support_containers})"
-  local logs="$(docker logs $jenkins)"
-  kill_containers ${__test_support_containers}
-  if [ -n "${__test_support_diagnostics}" ]; then
-    >&2 echo '
-*** LOG FROM THE JENKINS MASTER ***
-'"${logs}"'
-
-*** FAILURES SUMMARY ***
-'"${__test_support_diagnostics}
-"
-  exit 1
-  else
-    >&2 echo '
-
-*** ALL TESTS PASSED ***
-'
-  fi
-}
-
-# Utilities
-mcurl() {
-  local url="$1"
-  shift 1
-  # Since we are connecting to localhost and we tested the server is up and running,
-  # we limit the request to 1 seconds for connection and 10 seconds total
-  curl --connect-timeout 1 -m 10 -s "http://${DOCKER_SERVER}:${__test_support_port}${url}" "$@"
-}
-
-get_status_code() {
-  mcurl "$1" -I -L | grep '^HTTP/' | tail -1 | cut -d " " -f 2
-}
-
-diagnostics=
-report() {
-  echo "FAILED: $*" >&2
-  __test_support_diagnostics="${__test_support_diagnostics}
-$*"
-}
-
-test_status_code() {
-  local code="$(get_status_code "$1")"
-  if [ "$code" != "$2" ]; then
-    report "Got status $code while expecting $2 from $1"
-    mcurl "$1" -I -L >&2
-  else
-    echo "OK $1 returned $2"
-  fi
-}
-
-test_ok_status() {
-  test_status_code "$1" 200
-}
diff --git a/jenkins/test/test.sh b/jenkins/test/test.sh
deleted file mode 100755
index 7a5dcbf..0000000
--- a/jenkins/test/test.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2016 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Runs the jenkins test images inside the docker container.
-# Just a wrapper script to use the test support in run mode
-
-# So that the docker incremental loader knows where the runfiles are.
-export PYTHON_RUNFILES="${PYTHON_RUNFILES:-${BASH_SOURCE[0]}.runfiles}"
-cd "${PYTHON_RUNFILES}"
-PYTHON_RUNFILES="${PWD}"
-
-source "${PYTHON_RUNFILES}/io_bazel_ci/jenkins/test/common.sh"
-
-set -e
-
-# Port to serve Jenkins on, default is 8080.
-PORT=8080
-
-# Machine on which the docker daemon is running, default is localhost.
-: ${DOCKER_SERVER:=127.0.0.1}
-
-VOLUMES=()
-while getopts ":p:h:s:" opt; do
-  case "${opt}" in
-    p)
-      PORT="${OPTARG}"
-      ;;
-    h)
-      VOLUMES=(-v "${OPTARG}:/var/jenkins_home")
-      ;;
-    s)
-      VOLUMES=(-v "${OPTARG}:/opt/secrets")
-      ;;
-    *)
-      echo "Usage: $0 [-p <port>] [-s </volumes/secrets>] [-h </volumes/jenkins_home>]" >&2
-      exit 1
-      ;;
-  esac
-done
-
-containers="$(test_setup "${DOCKER_SERVER}" "${PORT}" "${VOLUMES[@]}")"
-attach ${containers}
-kill_containers ${containers}
diff --git a/jenkins/test/test_url_answer.sh b/jenkins/test/test_url_answer.sh
deleted file mode 100755
index e34e16e..0000000
--- a/jenkins/test/test_url_answer.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2017 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Simple test that run jenkins and verify that some content is there.
-
-# So that the docker incremental loader knows where the runfiles are.
-export PYTHON_RUNFILES="${PYTHON_RUNFILES:-${BASH_SOURCE[0]}.runfiles}"
-cd "${PYTHON_RUNFILES}"
-PYTHON_RUNFILES="${PWD}"
-
-source "${PYTHON_RUNFILES}/io_bazel_ci/jenkins/test/test-support.sh"
-setup
-
-test_ok_status "/job/bazel/job/presubmit/"
-test_ok_status "/job/bazel/job/nightly/"
-test_ok_status "/job/bazel/job/release/"
-test_ok_status "/job/maintenance/job/install-bazel/"
-test_ok_status "/job/maintenance/job/gerrit-verifier"
-
-test_ok_status "/job/rules_closure/"
-test_ok_status "/job/PR/job/rules_closure/"
-test_ok_status "/job/Global/job/rules_closure/"
-
-test_ok_status "/job/bazel-tests/"
-test_ok_status "/job/PR/job/bazel-tests/"
-test_ok_status "/job/CR/job/bazel-tests/"
-test_ok_status "/job/Global/job/bazel-tests/"
-
-teardown
diff --git a/jenkins/transfer-lib.sh b/jenkins/transfer-lib.sh
deleted file mode 100755
index 302c1a6..0000000
--- a/jenkins/transfer-lib.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash -eu
-#
-# Copyright 2017 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# A simple utility that copies the content of the groovy library to the test
-# jenkins docker container to test modification to the lib.
-
-: "${IMAGE_NAME:=bazel/jenkins:jenkins-test}"
-: "${CONTAINER_NAME:=$(docker ps | grep "${IMAGE_NAME}" | cut -f 1 -d " ")}"
-
-LIB_DIR="$(cd "$(dirname "$0")" && pwd -P)/lib"
-
-if [ -z "$CONTAINER_NAME" ]; then
-    echo "Could not find container running ${IMAGE_NAME}, is the test container running?" >&2
-    exit 1
-fi
-
-docker exec "$CONTAINER_NAME" bash -c 'rm -fr /opt/lib/*'
-for i in "$LIB_DIR/"*; do
-    docker cp "$i" "$CONTAINER_NAME:/opt/lib/"
-done
-docker exec "$CONTAINER_NAME" chown -R jenkins /opt/lib
-docker exec "$CONTAINER_NAME" su jenkins bash -c 'cd /opt/lib; git add .; git commit -m "Jenkins library: manual sync on $(date)"'