blob: a0914646527d2a277e327f3bd6db6969b41b6903 [file] [log] [blame]
Tim Windelschmidt32e74302025-01-15 04:37:26 +01001load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
2load("@bazel_skylib//rules:write_file.bzl", "write_file")
3load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
Tim Windelschmidt32e74302025-01-15 04:37:26 +01004
5oci_image(
6 name = "remote_worker_image",
7 base = "@distroless_base",
8 entrypoint = [],
9 tags = ["no-remote"],
Tim Windelschmidt66953ec2025-07-02 21:24:09 +020010 tars = [],
Tim Windelschmidt32e74302025-01-15 04:37:26 +010011 visibility = ["//visibility:private"],
12 workdir = "/root",
13)
14
15write_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.
25expand_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
33oci_push(
34 name = "remote_worker_push",
35 image = ":remote_worker_image",
36 remote_tags = ":stamped",
37 repository = "gcr.io/monogon-infra/sandbox",
38)