about summary refs log tree commit diff
path: root/src/payload-processor/cmd/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'src/payload-processor/cmd/BUILD.bazel')
-rw-r--r--src/payload-processor/cmd/BUILD.bazel21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/payload-processor/cmd/BUILD.bazel b/src/payload-processor/cmd/BUILD.bazel
index 7c89231..9a5fdb7 100644
--- a/src/payload-processor/cmd/BUILD.bazel
+++ b/src/payload-processor/cmd/BUILD.bazel
@@ -1,3 +1,4 @@
+load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_cross_binary", "go_library")
 load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push", "oci_tarball")
 load("@rules_pkg//:pkg.bzl", "pkg_tar")
@@ -16,6 +17,12 @@ go_library(
     ],
 )
 
+go_binary(
+    name = "cmd",
+    embed = [":cmd_lib"],
+    visibility = ["//visibility:public"],
+)
+
 go_cross_binary(
     name = "cmd_arm64",
     platform = "@io_bazel_rules_go//go/toolchain:linux_arm64",
@@ -43,14 +50,18 @@ oci_tarball(
     repo_tags = [],
 )
 
+expand_template(
+    name = "stamped",
+    out = "_stamped.tags.txt",
+    stamp = 1,
+    stamp_substitutions = {"tag": "payload-processor-{{STABLE_GIT_SHA}}"},
+    template = ["tag"],
+)
+
 oci_push(
     name = "push",
     image = ":image",
+    remote_tags = ":stamped",
     repository = "docker.io/baitinq/fs-tracer",
-)
-
-go_binary(
-    name = "cmd",
-    embed = [":cmd_lib"],
     visibility = ["//visibility:public"],
 )