2023-04-03 12:13:17 -04:00
|
|
|
"""
|
|
|
|
This folder contains labels used to collect release artifacts.
|
|
|
|
"""
|
|
|
|
|
|
|
|
load("@com_github_ash2k_bazel_tools//multirun:def.bzl", "multirun")
|
2023-04-27 05:52:02 -04:00
|
|
|
load("@rules_oci//oci:defs.bzl", "oci_push")
|
|
|
|
load("//bazel/oci:containers.bzl", "container_reponame", "containers")
|
|
|
|
load("//bazel/oci:pin.bzl", "oci_sum", "oci_sum_merge")
|
2023-04-03 12:13:17 -04:00
|
|
|
|
|
|
|
[
|
2023-04-27 05:52:02 -04:00
|
|
|
container_reponame(
|
|
|
|
name = container["name"] + "_reponame",
|
|
|
|
container_name = container["image_name"],
|
2023-04-03 12:13:17 -04:00
|
|
|
)
|
|
|
|
for container in containers()
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
2023-04-27 05:52:02 -04:00
|
|
|
genrule(
|
|
|
|
name = container["name"] + "_repotag",
|
|
|
|
srcs = [
|
|
|
|
"//bazel/release:" + container["name"] + "_reponame",
|
|
|
|
"//bazel/settings:tag",
|
|
|
|
],
|
|
|
|
outs = [container["repotag_file"]],
|
|
|
|
cmd = "echo -n ':' | cat $(location //bazel/release:" + container["name"] + "_reponame) - $(location //bazel/settings:tag) > $@",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
for container in containers()
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
|
|
|
oci_sum(
|
|
|
|
name = container["name"] + "_sum",
|
2023-04-03 12:13:17 -04:00
|
|
|
image_name = container["image_name"],
|
|
|
|
oci = container["oci"],
|
2023-04-27 05:52:02 -04:00
|
|
|
repotag_file = container["repotag_file"],
|
2023-04-03 12:13:17 -04:00
|
|
|
)
|
|
|
|
for container in containers()
|
|
|
|
]
|
|
|
|
|
|
|
|
oci_sum_merge(
|
|
|
|
name = "container_sums",
|
|
|
|
sums = [
|
|
|
|
":%s_sum" % container["name"]
|
|
|
|
for container in containers()
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
[
|
|
|
|
oci_push(
|
|
|
|
name = container["name"] + "_push",
|
|
|
|
image = container["oci"],
|
2023-12-19 09:40:04 -05:00
|
|
|
remote_tags = "//bazel/settings:tag",
|
|
|
|
repository_file = "//bazel/release:" + container["name"] + "_reponame",
|
2023-04-03 12:13:17 -04:00
|
|
|
)
|
|
|
|
for container in containers()
|
|
|
|
]
|
|
|
|
|
|
|
|
multirun(
|
|
|
|
name = "push",
|
|
|
|
commands = [
|
|
|
|
":" + container["name"] + "_push"
|
|
|
|
for container in containers()
|
|
|
|
],
|
|
|
|
jobs = 0, # execute in parallel
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2023-04-27 05:52:02 -04:00
|
|
|
|
|
|
|
multirun(
|
|
|
|
name = "build_and_push",
|
|
|
|
commands = [
|
|
|
|
"//bazel/release:push",
|
2023-05-30 03:05:36 -04:00
|
|
|
"//bazel/devbuild:devbuild",
|
2023-04-27 05:52:02 -04:00
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|