blob: a0914646527d2a277e327f3bd6db6969b41b6903 [file] [log] [blame]
load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
oci_image(
name = "remote_worker_image",
base = "@distroless_base",
entrypoint = [],
tags = ["no-remote"],
tars = [],
visibility = ["//visibility:private"],
workdir = "/root",
)
write_file(
name = "tags_tmpl",
out = "tags.txt.tmpl",
content = [
"BUILD_VERSION",
],
)
# Use the value of --embed_label under --stamp, otherwise use a deterministic constant
# value to ensure cache hits for actions that depend on this.
expand_template(
name = "stamped",
out = "_stamped.tags.txt",
stamp_substitutions = {"BUILD_VERSION": "{{STABLE_MONOGON_metropolis_version}}"},
substitutions = {"BUILD_VERSION": "0.0.0"},
template = "tags_tmpl",
)
oci_push(
name = "remote_worker_push",
image = ":remote_worker_image",
remote_tags = ":stamped",
repository = "gcr.io/monogon-infra/sandbox",
)