2023-04-03 12:13:17 -04:00
|
|
|
"""
|
|
|
|
This module holds the definitions of the containers that are built.
|
|
|
|
"""
|
|
|
|
|
2023-04-27 05:52:02 -04:00
|
|
|
load("@bazel_skylib//lib:paths.bzl", "paths")
|
|
|
|
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
|
2023-04-03 12:13:17 -04:00
|
|
|
|
|
|
|
def containers():
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
"identifier": "joinService",
|
|
|
|
"image_name": "join-service",
|
|
|
|
"name": "joinservice",
|
|
|
|
"oci": "//joinservice/cmd:joinservice",
|
2023-04-27 05:52:02 -04:00
|
|
|
"repotag_file": "//bazel/release:joinservice_tag.txt",
|
2023-04-03 12:13:17 -04:00
|
|
|
"used_by": ["helm"],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"identifier": "keyService",
|
|
|
|
"image_name": "key-service",
|
|
|
|
"name": "keyservice",
|
|
|
|
"oci": "//keyservice/cmd:keyservice",
|
2023-04-27 05:52:02 -04:00
|
|
|
"repotag_file": "//bazel/release:keyservice_tag.txt",
|
2023-04-03 12:13:17 -04:00
|
|
|
"used_by": ["helm"],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"identifier": "verificationService",
|
|
|
|
"image_name": "verification-service",
|
|
|
|
"name": "verificationservice",
|
|
|
|
"oci": "//verify/cmd:verificationservice",
|
2023-04-27 05:52:02 -04:00
|
|
|
"repotag_file": "//bazel/release:verificationservice_tag.txt",
|
2023-04-03 12:13:17 -04:00
|
|
|
"used_by": ["helm"],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"identifier": "constellationNodeOperator",
|
|
|
|
"image_name": "node-operator",
|
|
|
|
"name": "nodeoperator",
|
|
|
|
"oci": "//operators/constellation-node-operator:node_operator",
|
2023-04-27 05:52:02 -04:00
|
|
|
"repotag_file": "//bazel/release:nodeoperator_tag.txt",
|
2023-04-03 12:13:17 -04:00
|
|
|
"used_by": ["helm"],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"identifier": "qemuMetadata",
|
|
|
|
"image_name": "qemu-metadata-api",
|
|
|
|
"name": "qemumetadata",
|
|
|
|
"oci": "//hack/qemu-metadata-api:qemumetadata",
|
2023-04-27 05:52:02 -04:00
|
|
|
"repotag_file": "//bazel/release:qemumetadata_tag.txt",
|
2023-04-03 12:13:17 -04:00
|
|
|
"used_by": ["config"],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"identifier": "libvirt",
|
|
|
|
"image_name": "libvirt",
|
|
|
|
"name": "libvirt",
|
2023-11-28 04:52:37 -05:00
|
|
|
"oci": "@libvirtd_base//:libvirtd_base",
|
2023-04-27 05:52:02 -04:00
|
|
|
"repotag_file": "//bazel/release:libvirt_tag.txt",
|
2023-04-03 12:13:17 -04:00
|
|
|
"used_by": ["config"],
|
|
|
|
},
|
2023-09-27 05:40:32 -04:00
|
|
|
{
|
|
|
|
"identifier": "s3proxy",
|
|
|
|
"image_name": "s3proxy",
|
|
|
|
"name": "s3proxy",
|
|
|
|
"oci": "//s3proxy/cmd:s3proxy",
|
|
|
|
"repotag_file": "//bazel/release:s3proxy_tag.txt",
|
|
|
|
"used_by": ["config"],
|
|
|
|
},
|
2024-02-15 07:08:27 -05:00
|
|
|
{
|
|
|
|
"identifier": "vpn",
|
|
|
|
"image_name": "vpn",
|
|
|
|
"name": "vpn",
|
|
|
|
"oci": "//nix/container/vpn",
|
|
|
|
"repotag_file": "//bazel/release:vpn_tag.txt",
|
|
|
|
"used_by": ["config"],
|
|
|
|
},
|
2023-04-03 12:13:17 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
def helm_containers():
|
|
|
|
return [container for container in containers() if "helm" in container["used_by"]]
|
|
|
|
|
|
|
|
def config_containers():
|
|
|
|
return [container for container in containers() if "config" in container["used_by"]]
|
|
|
|
|
2023-04-27 05:52:02 -04:00
|
|
|
def _container_reponame_impl(ctx):
|
|
|
|
container_prefix = ctx.attr._prefix[BuildSettingInfo].value
|
|
|
|
if container_prefix == None:
|
|
|
|
fail("container_prefix is not set")
|
2023-04-03 12:13:17 -04:00
|
|
|
|
2023-04-27 05:52:02 -04:00
|
|
|
full_container_tag = paths.join(container_prefix, ctx.attr.container_name)
|
2023-04-03 12:13:17 -04:00
|
|
|
|
2023-04-27 05:52:02 -04:00
|
|
|
output = ctx.actions.declare_file(ctx.attr.container_name + "_container_repotag")
|
|
|
|
ctx.actions.write(output = output, content = full_container_tag)
|
|
|
|
return [DefaultInfo(files = depset([output]))]
|
2023-04-03 12:13:17 -04:00
|
|
|
|
2023-04-27 05:52:02 -04:00
|
|
|
container_reponame = rule(
|
|
|
|
implementation = _container_reponame_impl,
|
|
|
|
attrs = {
|
|
|
|
"container_name": attr.string(),
|
|
|
|
"_prefix": attr.label(default = Label("//bazel/settings:container_prefix")),
|
|
|
|
},
|
|
|
|
)
|