From 853a9d114cca4831dc750915be4c0631bcfe392c Mon Sep 17 00:00:00 2001 From: Michael Wilkerson Date: Thu, 20 Jul 2023 09:29:27 -0700 Subject: [PATCH 1/2] added make target for checking for hashicorppreview --- Makefile | 4 ++++ .../build-support/scripts/check-hashicorppreview.sh | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100755 control-plane/build-support/scripts/check-hashicorppreview.sh diff --git a/Makefile b/Makefile index 1d62035dbb..58e513aab2 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,10 @@ terraform-fmt: @terraform fmt -recursive .PHONY: terraform-fmt +# Check for hashicorppreview containers +check-preview-containers: + @source $(CURDIR)/control-plane/build-support/scripts/check-hashicorppreview.sh + # ===========> CLI Targets cli-dev: diff --git a/control-plane/build-support/scripts/check-hashicorppreview.sh b/control-plane/build-support/scripts/check-hashicorppreview.sh new file mode 100755 index 0000000000..6c94e12353 --- /dev/null +++ b/control-plane/build-support/scripts/check-hashicorppreview.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 +if grep -rnw -e 'hashicorppreviewsadfsd' './charts'; then + echo charts contain hashicorppreview images +else + echo charts do not contain hashicorpreview images +fi \ No newline at end of file From 128d8a70c693a30a5cc9818e16c5738ad16cb4f0 Mon Sep 17 00:00:00 2001 From: Michael Wilkerson Date: Thu, 20 Jul 2023 11:05:20 -0700 Subject: [PATCH 2/2] added check to prepare-release make target --- Makefile | 6 ++++-- .../build-support/scripts/check-hashicorppreview.sh | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 58e513aab2..4289b81b9b 100644 --- a/Makefile +++ b/Makefile @@ -225,7 +225,7 @@ aks-test-packages: check-env: @printenv | grep "CONSUL_K8S" -prepare-release: ## Sets the versions, updates changelog to prepare this repository to release +prepare-release-script: ## Sets the versions, updates changelog to prepare this repository to release ifndef CONSUL_K8S_RELEASE_VERSION $(error CONSUL_K8S_RELEASE_VERSION is required) endif @@ -238,7 +238,9 @@ endif ifndef CONSUL_K8S_CONSUL_VERSION $(error CONSUL_K8S_CONSUL_VERSION is required) endif - source $(CURDIR)/control-plane/build-support/scripts/functions.sh; prepare_release $(CURDIR) $(CONSUL_K8S_RELEASE_VERSION) "$(CONSUL_K8S_RELEASE_DATE)" $(CONSUL_K8S_LAST_RELEASE_GIT_TAG) $(CONSUL_K8S_CONSUL_VERSION) $(CONSUL_K8S_CONSUL_DATAPLANE_VERSION) $(CONSUL_K8S_PRERELEASE_VERSION) + @source $(CURDIR)/control-plane/build-support/scripts/functions.sh; prepare_release $(CURDIR) $(CONSUL_K8S_RELEASE_VERSION) "$(CONSUL_K8S_RELEASE_DATE)" $(CONSUL_K8S_LAST_RELEASE_GIT_TAG) $(CONSUL_K8S_CONSUL_VERSION) $(CONSUL_K8S_CONSUL_DATAPLANE_VERSION) $(CONSUL_K8S_PRERELEASE_VERSION); \ + +prepare-release: prepare-release-script check-preview-containers prepare-dev: ifndef CONSUL_K8S_RELEASE_VERSION diff --git a/control-plane/build-support/scripts/check-hashicorppreview.sh b/control-plane/build-support/scripts/check-hashicorppreview.sh index 6c94e12353..cd694dad93 100755 --- a/control-plane/build-support/scripts/check-hashicorppreview.sh +++ b/control-plane/build-support/scripts/check-hashicorppreview.sh @@ -1,8 +1,9 @@ #!/bin/bash # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: MPL-2.0 -if grep -rnw -e 'hashicorppreviewsadfsd' './charts'; then - echo charts contain hashicorppreview images +echo "Checking charts for hashicorpreview images. . ." +if grep -rnw -e 'hashicorppreview' './charts'; then + echo Charts contain hashicorppreview images. If this is intended for release, please remove the preview images. else - echo charts do not contain hashicorpreview images + echo Charts do not contain hashicorpreview images, ready for release! fi \ No newline at end of file