Use stamping and last commit year

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
This commit is contained in:
Maartje Eyskens 2020-10-08 16:56:07 +02:00
parent 50efbc0f6c
commit 6f49a347b4
3 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@ DOCKERIZED_BINARIES = {
# Since the multi_arch_container macro replaces the {ARCH} format string,
# we need to escape the stamping vars.
docker_tags = ["{{STABLE_DOCKER_REGISTRY}}/cert-manager-%s-{ARCH}:{{STABLE_DOCKER_TAG}}" % binary],
stamp = True,
stamp = 1,
symlinks = {
# Some cluster startup scripts expect to find the binaries in /usr/local/bin,
# but the debs install the binaries into /usr/bin.

View File

@ -20,9 +20,10 @@ genrule(
outs = ["boilerplate.bzl.timestamped.txt.out"],
cmd = " ".join([
"sed",
"s/YEAR/$$(date +\"%Y\")/",
"s/YEAR/$$(grep '^STABLE_LAST_COMMIT_YEAR' bazel-out/stable-status.txt | awk '{print $$2}')/",
"$(location :boilerplate.bzl.txt)",
"> $@",
]),
stamp = 1,
visibility = ["//visibility:public"],
)

View File

@ -33,6 +33,7 @@ if [ ! -z "$(git status --porcelain)" ]; then
fi
cat <<EOF
STABLE_LAST_COMMIT_YEAR $(git log -1 --date=format:"%Y" --format="%ad")
STABLE_BUILD_GIT_COMMIT ${KUBE_GIT_COMMIT-}
STABLE_BUILD_SCM_STATUS ${KUBE_GIT_TREE_STATE-}
STABLE_BUILD_SCM_REVISION ${KUBE_GIT_VERSION-}