Skip to content

Commit

Permalink
backport of commit 64a1679
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkermichael committed Jul 11, 2023
1 parent 29341e5 commit ad786c7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,34 +213,34 @@ aks-test-packages:
# ===========> Release Targets

prepare-release: ## Sets the versions, updates changelog to prepare this repository to release
ifndef RELEASE_VERSION
$(error RELEASE_VERSION is required)
ifndef CONSUL_K8S_RELEASE_VERSION
$(error CONSUL_K8S_RELEASE_VERSION is required)
endif
ifndef RELEASE_DATE
$(error RELEASE_DATE is required, use format <Month> <Day>, <Year> (ex. October 4, 2022))
ifndef CONSUL_K8S_RELEASE_DATE
$(error CONSUL_K8S_RELEASE_DATE is required, use format <Month> <Day>, <Year> (ex. October 4, 2022))
endif
ifndef LAST_RELEASE_GIT_TAG
$(error LAST_RELEASE_GIT_TAG is required)
ifndef CONSUL_K8S_LAST_RELEASE_GIT_TAG
$(error CONSUL_K8S_LAST_RELEASE_GIT_TAG is required)
endif
ifndef CONSUL_VERSION
$(error CONSUL_VERSION is required)
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) $(RELEASE_VERSION) "$(RELEASE_DATE)" $(LAST_RELEASE_GIT_TAG) $(CONSUL_VERSION) $(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_PRERELEASE_VERSION)

prepare-dev:
ifndef RELEASE_VERSION
$(error RELEASE_VERSION is required)
ifndef CONSUL_K8S_RELEASE_VERSION
$(error CONSUL_K8S_RELEASE_VERSION is required)
endif
ifndef RELEASE_DATE
$(error RELEASE_DATE is required, use format <Month> <Day>, <Year> (ex. October 4, 2022))
ifndef CONSUL_K8S_RELEASE_DATE
$(error CONSUL_K8S_RELEASE_DATE is required, use format <Month> <Day>, <Year> (ex. October 4, 2022))
endif
ifndef NEXT_RELEASE_VERSION
$(error NEXT_RELEASE_VERSION is required)
endif
ifndef NEXT_CONSUL_VERSION
$(error NEXT_CONSUL_VERSION is required)
endif
source $(CURDIR)/control-plane/build-support/scripts/functions.sh; prepare_dev $(CURDIR) $(RELEASE_VERSION) "$(RELEASE_DATE)" "" $(NEXT_RELEASE_VERSION) $(NEXT_CONSUL_VERSION)
source $(CURDIR)/control-plane/build-support/scripts/functions.sh; prepare_dev $(CURDIR) $(CONSUL_K8S_RELEASE_VERSION) "$(CONSUL_K8S_RELEASE_DATE)" "" $(NEXT_RELEASE_VERSION) $(NEXT_CONSUL_VERSION)

# ===========> Makefile config

Expand Down
8 changes: 4 additions & 4 deletions control-plane/build-support/functions/10-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -720,14 +720,14 @@ function set_changelog {
return 1
fi

if [ -z "$LAST_RELEASE_GIT_TAG" ]; then
echo "Error: LAST_RELEASE_GIT_TAG not specified."
if [ -z "$CONSUL_K8S_LAST_RELEASE_GIT_TAG" ]; then
echo "Error: CONSUL_K8S_LAST_RELEASE_GIT_TAG not specified."
exit 1
fi

cat <<EOT | cat - "${curdir}"/CHANGELOG.MD >tmp && mv tmp "${curdir}"/CHANGELOG.MD
## ${version} (${rel_date})
$(changelog-build -last-release ${LAST_RELEASE_GIT_TAG} \
$(changelog-build -last-release ${CONSUL_K8S_LAST_RELEASE_GIT_TAG} \
-entries-dir .changelog/ \
-changelog-template .changelog/changelog.tmpl \
-note-template .changelog/note.tmpl \
Expand Down Expand Up @@ -896,7 +896,7 @@ function ui_version {
return 1
fi

local ui_version=$(sed -n ${SED_EXT} -e 's/.*CONSUL_VERSION%22%3A%22([^%]*)%22%2C%22.*/\1/p' <"$1") || return 1
local ui_version=$(sed -n ${SED_EXT} -e 's/.*CONSUL_K8S_CONSUL_VERSION%22%3A%22([^%]*)%22%2C%22.*/\1/p' <"$1") || return 1
echo "$ui_version"
return 0
}
Expand Down

0 comments on commit ad786c7

Please sign in to comment.