Commit 4d88a4ed authored by Justin Santa Barbara's avatar Justin Santa Barbara

kube-up: move sha1sum-file into common

Also hash the tar files in AWS kube-up
parent a7041209
...@@ -566,10 +566,15 @@ function ensure-temp-dir { ...@@ -566,10 +566,15 @@ function ensure-temp-dir {
# SALT_TAR_URL # SALT_TAR_URL
function upload-server-tars() { function upload-server-tars() {
SERVER_BINARY_TAR_URL= SERVER_BINARY_TAR_URL=
SERVER_BINARY_TAR_HASH=
SALT_TAR_URL= SALT_TAR_URL=
SALT_TAR_HASH=
ensure-temp-dir 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 if [[ -z ${AWS_S3_BUCKET-} ]]; then
local project_hash= local project_hash=
local key=$(aws configure get aws_access_key_id) local key=$(aws configure get aws_access_key_id)
......
...@@ -441,3 +441,11 @@ function build-runtime-config() { ...@@ -441,3 +441,11 @@ function build-runtime-config() {
fi fi
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
}
...@@ -115,14 +115,6 @@ function detect-project () { ...@@ -115,14 +115,6 @@ function detect-project () {
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
}
function already-staged() { function already-staged() {
local -r file=$1 local -r file=$1
local -r newsum=$2 local -r newsum=$2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment