Skip to content

Commit

Permalink
Get the consul version from values.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
curtbushko committed May 17, 2023
1 parent 5bd6c60 commit 3fdcf96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions control-plane/build-support/scripts/consul-version.sh
Original file line number Diff line number Diff line change
@@ -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-

0 comments on commit 3fdcf96

Please sign in to comment.