CI: use manual GC tool
- Make new directories for the disk cache and output base.
- Prepend
--output_user_root="${OUTPUT_USER_ROOT}"
to all bazel commands to use the new output base. - Set
--max_idle_secs=10800
. By default, the server timeout is 3 hours because we are no longer using theTEST_TMPDIR
environment variable, but it is set to be sure. - Use environment variables in the Jenkins file to set variables needed by all CI scripts.
- Apply shellcheck to the CI scripts.
- Use stricter bash mode.
See Issue #24.
This builds the garbage collection tool mention in the disk cache docs, and stores it in the Jenkins cache to run.
The disk cache was separated from the Bazel output base, because the GC tool might clean files which cause Bazel be unable to run. The GC tool also leaves empty directories and dangling symlinks when used on the output base. We should create a job to clean up the output base from merged, abandoned, or old MRs.
New structure
/home/jenkins/cache/gtgen_core
├── bazel
│ ├── install
│ ├── cache
│ ├── <output_base_md5sum>
│ └── <another_output_base_md5sum>
├── bazelisk
│ └── downloads
├── bazel_disk_cache
│ ├── ac
│ ├── cas
│ ├── gc
│ └── tmp
└── bazel_gc_tool
├── gc (binary tool)
├── <other files>
└── gc.runfiles/
Edited by Stephen Ryan