| Tim Windelschmidt | 156248b | 2025-01-10 00:27:45 +0100 | [diff] [blame] | 1 | load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template") |
| Tim Windelschmidt | 0974b22 | 2024-01-16 14:04:15 +0100 | [diff] [blame] | 2 | load("@bazel_skylib//rules:write_file.bzl", "write_file") |
| Tim Windelschmidt | 44fdf7f | 2024-07-03 20:30:43 +0200 | [diff] [blame] | 3 | load("@rules_multirun//:defs.bzl", "multirun") |
| Tim Windelschmidt | 156248b | 2025-01-10 00:27:45 +0100 | [diff] [blame] | 4 | load("@rules_oci//oci:defs.bzl", "oci_push") |
| Tim Windelschmidt | 1fdab13 | 2023-03-30 15:04:16 +0200 | [diff] [blame] | 5 | |
| Tim Windelschmidt | 0974b22 | 2024-01-16 14:04:15 +0100 | [diff] [blame] | 6 | write_file( |
| 7 | name = "tags_tmpl", |
| 8 | out = "tags.txt.tmpl", |
| 9 | content = [ |
| 10 | "BUILD_VERSION", |
| 11 | ], |
| Tim Windelschmidt | 1fdab13 | 2023-03-30 15:04:16 +0200 | [diff] [blame] | 12 | ) |
| 13 | |
| Tim Windelschmidt | 0974b22 | 2024-01-16 14:04:15 +0100 | [diff] [blame] | 14 | # Use the value of --embed_label under --stamp, otherwise use a deterministic constant |
| 15 | # value to ensure cache hits for actions that depend on this. |
| 16 | expand_template( |
| 17 | name = "stamped", |
| 18 | out = "_stamped.tags.txt", |
| 19 | stamp_substitutions = {"BUILD_VERSION": "{{STABLE_MONOGON_cloud_version}}"}, |
| 20 | substitutions = {"BUILD_VERSION": "0.0.0"}, |
| 21 | template = "tags_tmpl", |
| 22 | ) |
| 23 | |
| Tim Windelschmidt | 0974b22 | 2024-01-16 14:04:15 +0100 | [diff] [blame] | 24 | oci_push( |
| 25 | name = "apigw_image", |
| 26 | image = "//cloud/apigw:apigw_image", |
| 27 | remote_tags = ":stamped", |
| 28 | repository = "gcr.io/monogon-infra/cloud/apigw", |
| 29 | ) |
| 30 | |
| 31 | oci_push( |
| 32 | name = "shepherd_equinix", |
| 33 | image = "//cloud/shepherd/provider/equinix:equinix_image", |
| 34 | remote_tags = ":stamped", |
| 35 | repository = "gcr.io/monogon-infra/cloud/shepherd/equinix", |
| 36 | ) |
| 37 | |
| 38 | oci_push( |
| 39 | name = "bmsrv", |
| 40 | image = "//cloud/bmaas/server/cmd:cmd_image", |
| 41 | remote_tags = ":stamped", |
| 42 | repository = "gcr.io/monogon-infra/cloud/bmsrv", |
| 43 | ) |
| 44 | |
| 45 | oci_push( |
| 46 | name = "scruffy", |
| 47 | image = "//cloud/bmaas/scruffy/cmd:cmd_image", |
| 48 | remote_tags = ":stamped", |
| 49 | repository = "gcr.io/monogon-infra/cloud/scruffy", |
| 50 | ) |
| 51 | |
| 52 | oci_push( |
| 53 | name = "shepherd_mini", |
| 54 | image = "//cloud/shepherd/mini:mini_image", |
| 55 | remote_tags = ":stamped", |
| 56 | repository = "gcr.io/monogon-infra/cloud/shepherd/mini", |
| Tim Windelschmidt | 1fdab13 | 2023-03-30 15:04:16 +0200 | [diff] [blame] | 57 | ) |
| Tim Windelschmidt | 44fdf7f | 2024-07-03 20:30:43 +0200 | [diff] [blame] | 58 | |
| 59 | multirun( |
| 60 | name = "push", |
| 61 | commands = [ |
| 62 | ":apigw_image", |
| 63 | ":shepherd_equinix", |
| 64 | ":bmsrv", |
| 65 | ":scruffy", |
| 66 | ":shepherd_mini", |
| 67 | ], |
| 68 | ) |