kube-up: move sha1sum-file into common

Also hash the tar files in AWS kube-up
pull/6/head
Justin Santa Barbara 2016-01-17 21:15:05 -05:00
parent a70412099a
commit 4d88a4ed2c
3 changed files with 13 additions and 8 deletions

View File

@ -566,10 +566,15 @@ function ensure-temp-dir {
# SALT_TAR_URL
function upload-server-tars() {
SERVER_BINARY_TAR_URL=
SERVER_BINARY_TAR_HASH=
SALT_TAR_URL=
SALT_TAR_HASH=
ensure-temp-dir
SERVER_BINARY_TAR_HASH=$(sha1sum-file "${SERVER_BINARY_TAR}")
SALT_TAR_HASH=$(sha1sum-file "${SALT_TAR}")
if [[ -z ${AWS_S3_BUCKET-} ]]; then
local project_hash=
local key=$(aws configure get aws_access_key_id)

View File

@ -441,3 +441,11 @@ function build-runtime-config() {
fi
fi
}
function sha1sum-file() {
if which shasum >/dev/null 2>&1; then
shasum -a1 "$1" | awk '{ print $1 }'
else
sha1sum "$1" | awk '{ print $1 }'
fi
}

View File

@ -115,14 +115,6 @@ function detect-project () {
fi
}
function sha1sum-file() {
if which shasum >/dev/null 2>&1; then
shasum -a1 "$1" | awk '{ print $1 }'
else
sha1sum "$1" | awk '{ print $1 }'
fi
}
function already-staged() {
local -r file=$1
local -r newsum=$2