tests: fix shfmt issues

This commit is contained in:
Jose Diaz-Gonzalez
2021-02-13 02:05:44 -05:00
parent 3681c17aa2
commit 02a8409114
5 changed files with 13 additions and 14 deletions

View File

@@ -13,7 +13,6 @@ trigger-builder-cnb-builder-build() {
return
fi
local stack="$(plugn trigger buildpack-stack-name "$APP")"
if [[ -z "$stack" ]]; then
DOKKU_CNB_STACK="$stack"
@@ -32,7 +31,7 @@ trigger-builder-cnb-builder-build() {
local TMP_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_FILE' >/dev/null" RETURN INT TERM
config_export app "$APP" --format envfile --merged > "$TMP_FILE"
config_export app "$APP" --format envfile --merged >"$TMP_FILE"
plugn trigger pre-build-cnb "$APP" "$SOURCECODE_WORK_DIR"

View File

@@ -54,7 +54,7 @@ domains_add() {
done
for DOMAIN in "$@"; do
if grep -x --line-regexp --fixed-strings "$DOMAIN" "$APP_VHOST_PATH" 2> /dev/null; then
if grep -x --line-regexp --fixed-strings "$DOMAIN" "$APP_VHOST_PATH" 2>/dev/null; then
dokku_log_info1 "Skipping: $DOMAIN already added to $APP"
else
echo "$DOMAIN" >>"$APP_VHOST_PATH"
@@ -149,7 +149,7 @@ domains_add_global() {
done
for DOMAIN in "$@"; do
if grep -q --line-regexp --fixed-strings "$DOMAIN" "$GLOBAL_VHOST_PATH" 2> /dev/null; then
if grep -q --line-regexp --fixed-strings "$DOMAIN" "$GLOBAL_VHOST_PATH" 2>/dev/null; then
dokku_log_info1 "Skipping $DOMAIN: already added"
else
echo "$DOMAIN" >>"$GLOBAL_VHOST_PATH"

View File

@@ -11,7 +11,7 @@ cmd-git-allow-host() {
declare HOST="$1"
[[ -z "$HOST" ]] && dokku_log_fail "Please supply a git host"
ssh-keyscan -t rsa "$HOST" >> "$DOKKU_ROOT/.ssh/known_hosts"
ssh-keyscan -t rsa "$HOST" >>"$DOKKU_ROOT/.ssh/known_hosts"
dokku_log_info1 "$HOST added to known hosts"
}
@@ -215,19 +215,19 @@ fn-git-fetch() {
fi
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
if ! git -C "$APP_ROOT" check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then
if ! git -C "$APP_ROOT" check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then
echo $'\e[1G\e[K'"-----> WARNING: Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via DOKKU_DEPLOY_BRANCH."
echo $'\e[1G\e[K'"-----> For more details, please see the man page for 'git-check-ref-format.'"
return
fi
git -C "$APP_ROOT" remote rm remote > /dev/null 2>&1 || true
git -C "$APP_ROOT" remote add --mirror=fetch --no-tags remote "$GIT_REMOTE"
git -C "$APP_ROOT" remote rm remote > /dev/null 2>&1 || true
git -C "$APP_ROOT" remote add --mirror=fetch --no-tags remote "$GIT_REMOTE"
if [[ -z "$GIT_REF" ]]; then
git -C "$APP_ROOT" fetch --update-head-ok remote "$DOKKU_DEPLOY_BRANCH"
git -C "$APP_ROOT" fetch --update-head-ok remote "$DOKKU_DEPLOY_BRANCH"
else
git -C "$APP_ROOT" fetch --update-head-ok remote
git -C "$APP_ROOT" update-ref "refs/heads/$DOKKU_DEPLOY_BRANCH" "$GIT_REF"
git -C "$APP_ROOT" fetch --update-head-ok remote
git -C "$APP_ROOT" update-ref "refs/heads/$DOKKU_DEPLOY_BRANCH" "$GIT_REF"
fi
}

View File

@@ -77,7 +77,7 @@ install_dokku() {
build_dokku
fi
cat << EOF | sudo debconf-set-selections
cat <<EOF | sudo debconf-set-selections
dokku dokku/hostname string dokku.me
dokku dokku/key_file string /root/.ssh/id_rsa.pub
dokku dokku/nginx_enable boolean true

View File

@@ -510,14 +510,14 @@ add_release_command() {
local APP="$1"
local APP_REPO_DIR="$2"
[[ -z "$APP" ]] && local APP="$TEST_APP"
echo "release: touch /app/release.test" >> "$APP_REPO_DIR/Procfile"
echo "release: touch /app/release.test" >>"$APP_REPO_DIR/Procfile"
}
add_requirements_txt() {
local APP="$1"
local APP_REPO_DIR="$2"
[[ -z "$APP" ]] && local APP="$TEST_APP"
echo "flask" >> "$APP_REPO_DIR/requirements.txt"
echo "flask" >>"$APP_REPO_DIR/requirements.txt"
}
build_nginx_config() {