From 88288a1819632e7ef76c1dcb1f68ca82f4ede7c8 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Mon, 18 Mar 2019 15:05:32 -0400 Subject: [PATCH] accept macos host as a env-var with a default --- scripts/release/mac-remote-build | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/release/mac-remote-build b/scripts/release/mac-remote-build index 8ee6b6946..bf386aa18 100755 --- a/scripts/release/mac-remote-build +++ b/scripts/release/mac-remote-build @@ -14,17 +14,19 @@ fi TMP_WORKSPACE="/tmp/nomad-workspace/$(date +%Y-%m-%d-%s)" REPO_REMOTE_PATH="${TMP_WORKSPACE}/gopath/src/github.com/hashicorp/nomad" +readonly remote_macos_host=${REMOTE_MACOS_HOST:-sharedmac-bot} + echo "Using temp workspace: ${TMP_WORKSPACE}" echo echo '=======>>>> Transfering repository' -ssh sharedmac-bot mkdir -p "${REPO_REMOTE_PATH}" +ssh ${remote_macos_host} mkdir -p "${REPO_REMOTE_PATH}" rsync -az \ "${REPO}/.git" \ - "sharedmac-bot:${REPO_REMOTE_PATH}" + "${remote_macos_host}:${REPO_REMOTE_PATH}" echo '=======>>>> Compiling Mac Binaries' -cat <<'EOF' | ssh sharedmac-bot /bin/bash -s "${TMP_WORKSPACE}" +cat <<'EOF' | ssh ${remote_macos_host} /bin/bash -s "${TMP_WORKSPACE}" set -o errexit set -o xtrace @@ -68,6 +70,6 @@ compile EOF echo '=======>>>> Retreiving mac compiled binaries' -rsync -avz --ignore-existing sharedmac-bot:"${REPO_REMOTE_PATH}/pkg/" "${REPO}/pkg" +rsync -avz --ignore-existing ${remote_macos_host}:"${REPO_REMOTE_PATH}/pkg/" "${REPO}/pkg" -ssh sharedmac-bot rm -rf "${TMP_WORKSPACE}" +ssh ${remote_macos_host} rm -rf "${TMP_WORKSPACE}"