diff --git a/build-support/functions/00-vars.sh b/build-support/functions/00-vars.sh index 03e800b015..c53cffecec 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 0429adbce8..edf783a6c2 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 60efe8debf..bbc3dc1ada 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