Note: the first bazel build is going to stall for some time while building the base images on docker without any output due to bazelbuild/bazel#1289.
Docker:
At least 25GB of free disk space.
Your username in the “docker” group.
Follow the instructions on Ask Ubuntu.
Gcloud:
You may need to authenticate and set the current project. To do so, run:
gcloud auth login gcloud set project bazel-public
The typical worflow when modfiying ci.bazel.build is to first test the change on ci-staging.bazel.build.
The process typically looks like:
Make your change
Add a few jobs to test to jenkins/jobs/jobs.bzl
.
Start the staging Jenkins instance with ./gce/vm.sh start staging
.
Run bazel run //gcr:deploy-staging
to deploy the change to the staging instance.
Restart the staging Jenkins instance by going to https://ci-staging.bazel.build/safeExit .
Run a job by identifying it on [https://ci-staging.bazel.build] and clicking on the play button.
If 6 fails, go back to 1, skipping step 3.
Send the change to review.
Shut down the staging Jenkins instance with ./gce/vm.sh stop staging
.
Once LGTM, deploy to production with bazel run //gcr:deploy
.
Restart the prod Jenkins instance: https://ci.bazel.build/safeExit
You need to log in to the Jenkins UI, otherwise you may get a stack trace. Log in and try again.
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:
port
(8080 by default)This setup should suffice for local testing.
To stop the instance, go to http://localhost:8080/safeExit
. 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:
If you only need to modify Groovy code under jenkins/lib
, you can update that in the running container without restarting Jenkins.
start the container
bazel run //jenkins:test
make your changes to .groovy
files
transfor the lib
folder to the running container:
jenkins/transfer-lib.sh
start the instance
gce/vm.sh start staging
make your changes to .groovy
files
transfor the lib
folder to the container running on the staging instance
jenkins/transfer-lib-to-staging.sh
stop the instance when done
gce/vm.sh stop staging