From 3fdcf9695bd1c8e201aca22ee1a3a25778ffcd9d Mon Sep 17 00:00:00 2001 From: Curt Bushko Date: Wed, 17 May 2023 16:10:36 -0400 Subject: [PATCH] Get the consul version from values.yaml --- Makefile | 5 +++++ control-plane/build-support/scripts/consul-version.sh | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100755 control-plane/build-support/scripts/consul-version.sh diff --git a/Makefile b/Makefile index daee6b693b..ea94b303e9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ VERSION = $(shell ./control-plane/build-support/scripts/version.sh control-plane/version/version.go) +CONSUL_VERSION = $(shell ./control-plane/build-support/scripts/consul-version.sh charts/consul/values.yaml) # ===========> Helm Targets @@ -147,6 +148,10 @@ ci.aws-acceptance-test-cleanup: ## Deletes AWS resources left behind after faile version: @echo $(VERSION) +consul-version: + @echo $(CONSUL_VERSION) + + # ===========> Release Targets prepare-release: ## Sets the versions, updates changelog to prepare this repository to release diff --git a/control-plane/build-support/scripts/consul-version.sh b/control-plane/build-support/scripts/consul-version.sh new file mode 100755 index 0000000000..634b5db07d --- /dev/null +++ b/control-plane/build-support/scripts/consul-version.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 +FILE=$1 +VERSION=$(yq .global.image $FILE) + +# echo full string "hashicorp/consul:1.15.1" | remove first and last characters | cut everything before ':' +echo "${VERSION}" | sed 's/^.//;s/.$//' | cut -d ':' -f2-