| Tim Windelschmidt | 32e7430 | 2025-01-15 04:37:26 +0100 | [diff] [blame] | 1 | load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template") |
| 2 | load("@bazel_skylib//rules:write_file.bzl", "write_file") |
| 3 | load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push") |
| Tim Windelschmidt | 32e7430 | 2025-01-15 04:37:26 +0100 | [diff] [blame] | 4 | |
| 5 | oci_image( |
| 6 | name = "remote_worker_image", |
| 7 | base = "@distroless_base", |
| 8 | entrypoint = [], |
| 9 | tags = ["no-remote"], |
| Tim Windelschmidt | 66953ec | 2025-07-02 21:24:09 +0200 | [diff] [blame^] | 10 | tars = [], |
| Tim Windelschmidt | 32e7430 | 2025-01-15 04:37:26 +0100 | [diff] [blame] | 11 | visibility = ["//visibility:private"], |
| 12 | workdir = "/root", |
| 13 | ) |
| 14 | |
| 15 | write_file( |
| 16 | name = "tags_tmpl", |
| 17 | out = "tags.txt.tmpl", |
| 18 | content = [ |
| 19 | "BUILD_VERSION", |
| 20 | ], |
| 21 | ) |
| 22 | |
| 23 | # Use the value of --embed_label under --stamp, otherwise use a deterministic constant |
| 24 | # value to ensure cache hits for actions that depend on this. |
| 25 | expand_template( |
| 26 | name = "stamped", |
| 27 | out = "_stamped.tags.txt", |
| 28 | stamp_substitutions = {"BUILD_VERSION": "{{STABLE_MONOGON_metropolis_version}}"}, |
| 29 | substitutions = {"BUILD_VERSION": "0.0.0"}, |
| 30 | template = "tags_tmpl", |
| 31 | ) |
| 32 | |
| 33 | oci_push( |
| 34 | name = "remote_worker_push", |
| 35 | image = ":remote_worker_image", |
| 36 | remote_tags = ":stamped", |
| 37 | repository = "gcr.io/monogon-infra/sandbox", |
| 38 | ) |