From d625884a1ebd486a5dbc8ea1f447c0c6c1c43b81 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sat, 21 Oct 2023 02:59:26 +0200
Subject: [PATCH] fix(opentf): Fix broken CI builds due to tag covering
 branches

---
 images/opentf/.gitignore | 1 +
 images/opentf/Earthfile  | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 images/opentf/.gitignore

diff --git a/images/opentf/.gitignore b/images/opentf/.gitignore
new file mode 100644
index 000000000..244d99ba8
--- /dev/null
+++ b/images/opentf/.gitignore
@@ -0,0 +1 @@
+tofu
\ No newline at end of file
diff --git a/images/opentf/Earthfile b/images/opentf/Earthfile
index 720e87f0f..c77863cb1 100644
--- a/images/opentf/Earthfile
+++ b/images/opentf/Earthfile
@@ -16,7 +16,7 @@ build:
     RUN go mod download && go mod verify
     COPY +src/src/ ./
     RUN go build -ldflags "-s -w" -mod=readonly -trimpath ./cmd/tofu
-    SAVE ARTIFACT ./tofu ./tofu
+    SAVE ARTIFACT ./tofu ./tofu AS LOCAL ./tofu
 
 container-internal:
     FROM ../mirror+distroless-static
@@ -34,10 +34,10 @@ container:
     ARG tag=$(awk -F'=' '$1 == "release" {print $2}' .release)
     ARG latest=false
     IF [ $latest = "true" ]
-        FROM +container-internal --branch=v${tag}
+        FROM +container-internal --branch=v$(awk -F'=' '$1 == "release" {print $2}' .release)
         SAVE IMAGE --push ${registry}:latest
     ELSE
-        FROM +container-internal --branch=v${tag}
+        FROM +container-internal --branch=v$(awk -F'=' '$1 == "release" {print $2}' .release)
         LABEL "quay.expires-after"="12w"
     END
     SAVE IMAGE --push ${registry}:${tag}
-- 
GitLab