From 588cfbb3599195156daf18ebd93ba51447bce60c Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Mon, 18 Jun 2018 09:32:00 -0400 Subject: [PATCH] Add notion of a consul pkg name to coexist with enterprise --- build-support/functions/00-vars.sh | 2 ++ build-support/functions/30-release.sh | 32 +++++++++++++-------------- build-support/functions/40-publish.sh | 4 ++-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/build-support/functions/00-vars.sh b/build-support/functions/00-vars.sh index 03e800b01..c53cffece 100644 --- a/build-support/functions/00-vars.sh +++ b/build-support/functions/00-vars.sh @@ -27,6 +27,8 @@ PUBLISH_GIT_HOST="${PUBLISH_GIT_HOST-github.com}" # default publish repo is hashicorp/consul - useful to override for testing as well as in the enterprise repo PUBLISH_GIT_REPO="${PUBLISH_GIT_REPO-hashicorp/consul.git}" +CONSUL_PKG_NAME="consul" + if test "$(uname)" == "Darwin" then SED_EXT="-E" diff --git a/build-support/functions/30-release.sh b/build-support/functions/30-release.sh index 0429adbce..edf783a6c 100644 --- a/build-support/functions/30-release.sh +++ b/build-support/functions/30-release.sh @@ -177,25 +177,25 @@ function check_release { declare -a expected_files - expected_files+=("consul_${2}_SHA256SUMS") + expected_files+=("${CONSUL_PKG_NAME}_${2}_SHA256SUMS") echo "check sig: $3" if is_set "$3" then - expected_files+=("consul_${2}_SHA256SUMS.sig") + expected_files+=("${CONSUL_PKG_NAME}_${2}_SHA256SUMS.sig") fi - expected_files+=("consul_${2}_darwin_386.zip") - expected_files+=("consul_${2}_darwin_amd64.zip") - expected_files+=("consul_${2}_freebsd_386.zip") - expected_files+=("consul_${2}_freebsd_amd64.zip") - expected_files+=("consul_${2}_freebsd_arm.zip") - expected_files+=("consul_${2}_linux_386.zip") - expected_files+=("consul_${2}_linux_amd64.zip") - expected_files+=("consul_${2}_linux_arm.zip") - expected_files+=("consul_${2}_linux_arm64.zip") - expected_files+=("consul_${2}_solaris_amd64.zip") - expected_files+=("consul_${2}_windows_386.zip") - expected_files+=("consul_${2}_windows_amd64.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_darwin_386.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_darwin_amd64.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_freebsd_386.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_freebsd_amd64.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_freebsd_arm.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_linux_386.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_linux_amd64.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_linux_arm.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_linux_arm64.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_solaris_amd64.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_windows_386.zip") + expected_files+=("${CONSUL_PKG_NAME}_${2}_windows_amd64.zip") declare -a found_files @@ -420,7 +420,7 @@ function build_release { fi status_stage "==> Generating SHA 256 Hashes for Binaries" - shasum_release "${sdir}/pkg/dist" "consul_${vers}_SHA256SUMS" + shasum_release "${sdir}/pkg/dist" "${CONSUL_PKG_NAME}_${vers}_SHA256SUMS" if test $? -ne 0 then err "ERROR: Failed to generate SHA 256 hashes for the release" @@ -429,7 +429,7 @@ function build_release { if is_set "${do_sha256}" then - sign_release "${sdir}/pkg/dist/consul_${vers}_SHA256SUMS" "${gpg_key}" + sign_release "${sdir}/pkg/dist/${CONSUL_PKG_NAME}_${vers}_SHA256SUMS" "${gpg_key}" if test $? -ne 0 then err "ERROR: Failed to sign the SHA 256 hashes file" diff --git a/build-support/functions/40-publish.sh b/build-support/functions/40-publish.sh index 60efe8deb..bbc3dc1ad 100644 --- a/build-support/functions/40-publish.sh +++ b/build-support/functions/40-publish.sh @@ -79,7 +79,7 @@ function confirm_consul_version { # 0 - success # * - error - local zfile="${1}/consul_${2}_$(go env GOOS)_$(go env GOARCH).zip" + local zfile="${1}/${CONSUL_PKG_NAME}_${2}_$(go env GOOS)_$(go env GOARCH).zip" if ! test -f "${zfile}" then @@ -88,7 +88,7 @@ function confirm_consul_version { fi local ret=0 - local tfile="$(mktemp) -t "consul_")" + local tfile="$(mktemp) -t "${CONSUL_PKG_NAME}_")" unzip -p "${zfile}" "consul" > "${tfile}" if test $? -eq 0