Add notion of a consul pkg name to coexist with enterprise

This commit is contained in:
Matt Keeler 2018-06-18 09:32:00 -04:00
parent 551cf5a77b
commit 588cfbb359
3 changed files with 20 additions and 18 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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