cleanup shellcheck SC2086
This commit is contained in:
committed by
Test Robot
parent
ff9bb2cbd7
commit
d1b87bd7b7
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " tar-from tar:from tar-in tar:in tar-build tar-build-locked help tar:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
[[ " tar-from tar:from tar-in tar:in tar-build tar-build-locked help tar:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
@@ -9,14 +9,14 @@ case "$1" in
|
||||
APP=$2
|
||||
URL=$3
|
||||
shift 3
|
||||
curl -# --insecure -L "$URL" | dokku tar-in $APP "$@"
|
||||
curl -# --insecure -L "$URL" | dokku tar-in "$APP" "$@"
|
||||
;;
|
||||
|
||||
tar-in|tar:in)
|
||||
APP="$2"
|
||||
verify_app_name "$2"
|
||||
tee "$DOKKU_ROOT/$APP/src.tar" | wc -c
|
||||
plugn trigger receive-app $APP
|
||||
plugn trigger receive-app "$APP"
|
||||
;;
|
||||
|
||||
tar-build)
|
||||
@@ -35,12 +35,12 @@ case "$1" in
|
||||
shift 2
|
||||
|
||||
# clean up after ourselves
|
||||
TMP_WORK_DIR=$(mktemp -d)
|
||||
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN
|
||||
TMP_WORK_DIR=$(mktemp -d -t "dokku_tar.XXXX")
|
||||
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' INT TERM EXIT
|
||||
|
||||
# extract tar file
|
||||
chmod 755 $TMP_WORK_DIR
|
||||
pushd $TMP_WORK_DIR > /dev/null
|
||||
chmod 755 "$TMP_WORK_DIR"
|
||||
pushd "$TMP_WORK_DIR" > /dev/null
|
||||
|
||||
# Detect a common prefix that all files in the tar have, and strip off each directory found in it
|
||||
COMMON_PREFIX=$(tar -tf "$DOKKU_ROOT/$APP/src.tar" | sed -e 'N;s/^\(.*\).*\n\1.*$/\1\n\1/;D')
|
||||
@@ -48,7 +48,7 @@ case "$1" in
|
||||
|
||||
dokku_log_info1_quiet "Striping $BOGUS_PARTS worth of directories from tarball"
|
||||
|
||||
tar -x -C "$TMP_WORK_DIR" -f "$DOKKU_ROOT/$APP/src.tar" --strip-components=$BOGUS_PARTS
|
||||
tar -x -C "$TMP_WORK_DIR" -f "$DOKKU_ROOT/$APP/src.tar" --strip-components="$BOGUS_PARTS"
|
||||
chmod -R u+r "$TMP_WORK_DIR"
|
||||
|
||||
if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then
|
||||
@@ -68,7 +68,7 @@ EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -8,5 +8,5 @@ APP="$1"; REV="$2"
|
||||
if [[ ! -f "$DOKKU_ROOT/$APP/src.tar" ]]; then
|
||||
true
|
||||
else
|
||||
dokku tar-build $APP
|
||||
dokku tar-build "$APP"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user