| Tim Windelschmidt | 0974b22 | 2024-01-16 14:04:15 +0100 | [diff] [blame] | 1 | load("@bazel_skylib//rules:write_file.bzl", "write_file") |
| Tim Windelschmidt | 44fdf7f | 2024-07-03 20:30:43 +0200 | [diff] [blame^] | 2 | load("@rules_multirun//:defs.bzl", "multirun") |
| Tim Windelschmidt | 1fdab13 | 2023-03-30 15:04:16 +0200 | [diff] [blame] | 3 | |
| Tim Windelschmidt | 0974b22 | 2024-01-16 14:04:15 +0100 | [diff] [blame] | 4 | write_file( |
| 5 | name = "tags_tmpl", |
| 6 | out = "tags.txt.tmpl", |
| 7 | content = [ |
| 8 | "BUILD_VERSION", |
| 9 | ], |
| Tim Windelschmidt | 1fdab13 | 2023-03-30 15:04:16 +0200 | [diff] [blame] | 10 | ) |
| 11 | |
| Tim Windelschmidt | 0974b22 | 2024-01-16 14:04:15 +0100 | [diff] [blame] | 12 | load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template") |
| 13 | |
| 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 | |
| 24 | load("@rules_oci//oci:defs.bzl", "oci_push") |
| 25 | |
| 26 | oci_push( |
| 27 | name = "apigw_image", |
| 28 | image = "//cloud/apigw:apigw_image", |
| 29 | remote_tags = ":stamped", |
| 30 | repository = "gcr.io/monogon-infra/cloud/apigw", |
| 31 | ) |
| 32 | |
| 33 | oci_push( |
| 34 | name = "shepherd_equinix", |
| 35 | image = "//cloud/shepherd/provider/equinix:equinix_image", |
| 36 | remote_tags = ":stamped", |
| 37 | repository = "gcr.io/monogon-infra/cloud/shepherd/equinix", |
| 38 | ) |
| 39 | |
| 40 | oci_push( |
| 41 | name = "bmsrv", |
| 42 | image = "//cloud/bmaas/server/cmd:cmd_image", |
| 43 | remote_tags = ":stamped", |
| 44 | repository = "gcr.io/monogon-infra/cloud/bmsrv", |
| 45 | ) |
| 46 | |
| 47 | oci_push( |
| 48 | name = "scruffy", |
| 49 | image = "//cloud/bmaas/scruffy/cmd:cmd_image", |
| 50 | remote_tags = ":stamped", |
| 51 | repository = "gcr.io/monogon-infra/cloud/scruffy", |
| 52 | ) |
| 53 | |
| 54 | oci_push( |
| 55 | name = "shepherd_mini", |
| 56 | image = "//cloud/shepherd/mini:mini_image", |
| 57 | remote_tags = ":stamped", |
| 58 | repository = "gcr.io/monogon-infra/cloud/shepherd/mini", |
| Tim Windelschmidt | 1fdab13 | 2023-03-30 15:04:16 +0200 | [diff] [blame] | 59 | ) |
| Tim Windelschmidt | 44fdf7f | 2024-07-03 20:30:43 +0200 | [diff] [blame^] | 60 | |
| 61 | multirun( |
| 62 | name = "push", |
| 63 | commands = [ |
| 64 | ":apigw_image", |
| 65 | ":shepherd_equinix", |
| 66 | ":bmsrv", |
| 67 | ":scruffy", |
| 68 | ":shepherd_mini", |
| 69 | ], |
| 70 | ) |