Skip to content

Commit b30922a

Browse files
committed
Inline some variables
1 parent ee6218b commit b30922a

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

project-fortis-spark/travis/publish.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22

33
set -euo pipefail
44

5-
readonly tag="${TRAVIS_TAG}"
6-
readonly blobaccount="${DEPLOY_BLOB_ACCOUNT_NAME}"
7-
readonly blobkey="${DEPLOY_BLOB_ACCOUNT_KEY}"
8-
readonly blobcontainer="${DEPLOY_BLOB_CONTAINER}"
9-
readonly blobname="fortis-${tag}.jar"
10-
115
log() {
126
echo "$@" >&2
137
}
148

159
check_preconditions() {
16-
if [ -z "${tag}" ]; then
10+
if [ -z "${TRAVIS_TAG}" ]; then
1711
log "Build is not a tag, skipping publish"
1812
exit 0
1913
fi
20-
if [ -z "${blobaccount}" ] || [ -z "${blobkey}" ] || [ -z "${blobcontainer}" ]; then
14+
if [ -z "${DEPLOY_BLOB_ACCOUNT_NAME}" ] || [ -z "${DEPLOY_BLOB_ACCOUNT_KEY}" ] || [ -z "${DEPLOY_BLOB_CONTAINER}" ]; then
2115
log "Azure blob connection is not set, unable to publish builds"
2216
exit 1
2317
fi
@@ -37,6 +31,7 @@ create_fat_jar() {
3731

3832
publish_fat_jar() {
3933
local fatjar="$(find target -name 'project-fortis-spark-assembly-*.jar' -print -quit)"
34+
4035
if [ -z "${fatjar}" ] || [ ! -f "${fatjar}" ]; then
4136
log "Unable to locate fat jar"
4237
exit 1
@@ -45,11 +40,11 @@ publish_fat_jar() {
4540
AZURE_NON_INTERACTIVE_MODE=1 \
4641
azure storage blob upload \
4742
--quiet \
48-
--account-name "${blobaccount}" \
49-
--account-key "${blobkey}" \
43+
--account-name "${DEPLOY_BLOB_ACCOUNT_NAME}" \
44+
--account-key "${DEPLOY_BLOB_ACCOUNT_KEY}" \
5045
--file "${fatjar}" \
51-
--container "${blobcontainer}" \
52-
--blob "${blobname}"
46+
--container "${DEPLOY_BLOB_CONTAINER}" \
47+
--blob "fortis-${TRAVIS_TAG}.jar"
5348
}
5449

5550
pushd "$(dirname $0)/.."

0 commit comments

Comments
 (0)