From 205b2ec9959e41b21c3eba67f13f6f7196df38d4 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Tue, 23 Jan 2024 11:53:42 +0100 Subject: [PATCH] Fix drone bug. Autoscaler image not being pushed Signed-off-by: Manuel Buil --- .drone.yml | 11 +++++++++++ Makefile | 3 +++ manifest-autoscaler.tmpl | 7 ++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index dca8668..6f75f00 100644 --- a/.drone.yml +++ b/.drone.yml @@ -155,6 +155,15 @@ platform: os: linux arch: amd64 steps: + - name: extract-tag + image: alpine + commands: + - apk add --no-cache make + - echo $(make -s print-autoscaler-tag) > ./tag.txt + when: + event: + - tag + - name: push image: plugins/manifest:1.2.3 settings: @@ -164,9 +173,11 @@ steps: from_secret: docker_username spec: manifest-autoscaler.tmpl ignore_missing: true + template: ./tag.txt when: event: - tag + depends_on: - linux-amd64 - linux-arm64 diff --git a/Makefile b/Makefile index 130b0fd..01910e6 100644 --- a/Makefile +++ b/Makefile @@ -88,3 +88,6 @@ image-manifest-autoscaler: image-scan-autoscaler: trivy image --severity $(SEVERITIES) --no-progress --ignore-unfixed $(ORG)/hardened-cluster-autoscaler:$(AUTOSCALER_TAG) +.PHONY: print-autoscaler-tag +print-autoscaler-tag: + echo ${AUTOSCALER_TAG} diff --git a/manifest-autoscaler.tmpl b/manifest-autoscaler.tmpl index 7d5d3b7..361e23b 100644 --- a/manifest-autoscaler.tmpl +++ b/manifest-autoscaler.tmpl @@ -1,12 +1,13 @@ -image: rancher/hardened-cluster-autoscaler:{{build.tag}} +# {{ . }} is consuming the extracted value in tag.txt templated in manifest-autoscaler drone pipeline +image: rancher/hardened-cluster-autoscaler:{{ . }} manifests: - - image: rancher/hardened-cluster-autoscaler:{{build.tag}}-amd64 + image: rancher/hardened-cluster-autoscaler:{{ . }}-amd64 platform: architecture: amd64 os: linux - - image: rancher/hardened-cluster-autoscaler:{{build.tag}}-arm64 + image: rancher/hardened-cluster-autoscaler:{{ . }}-arm64 platform: architecture: arm64 os: linux