tests: run mvdan/shfmt on test runs
While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™. The command used to reprocess everything is: ```shell shfmt -l -bn -ci -i 2 -w . ```
This commit is contained in:
1 parent
fb7c73a7e3
commit
86795ddacc
275 files changed
+1038
-520
No files matched your search
+3
-2
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $TRACE ]] && set -x
|
||||||
|
|
||||||
# A script to bootstrap dokku.
|
# A script to bootstrap dokku.
|
||||||
# It expects to be run on Ubuntu 14.04 via 'sudo'
|
# It expects to be run on Ubuntu 14.04 via 'sudo'
|
||||||
@@ -47,7 +48,7 @@ install-dokku() {
|
|||||||
if [[ -n $DOKKU_BRANCH ]]; then
|
if [[ -n $DOKKU_BRANCH ]]; then
|
||||||
install-dokku-from-source "origin/$DOKKU_BRANCH"
|
install-dokku-from-source "origin/$DOKKU_BRANCH"
|
||||||
elif [[ -n $DOKKU_TAG ]]; then
|
elif [[ -n $DOKKU_TAG ]]; then
|
||||||
local DOKKU_SEMVER="${DOKKU_TAG//v}"
|
local DOKKU_SEMVER="${DOKKU_TAG//v/}"
|
||||||
major=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[1]}')
|
major=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[1]}')
|
||||||
minor=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[2]}')
|
minor=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[2]}')
|
||||||
patch=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[3]}')
|
patch=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[3]}')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
export DOKKU_PORT=${DOKKU_PORT:=22}
|
export DOKKU_PORT=${DOKKU_PORT:=22}
|
||||||
export DOKKU_HOST=${DOKKU_HOST:=}
|
export DOKKU_HOST=${DOKKU_HOST:=}
|
||||||
|
|
||||||
|
|||||||
@@ -131,14 +131,14 @@ EOF
|
|||||||
patch=$(echo "$CURRENT_VERSION" | awk '{split($0,a,"."); print a[3]}')
|
patch=$(echo "$CURRENT_VERSION" | awk '{split($0,a,"."); print a[3]}')
|
||||||
|
|
||||||
if [[ "$RELEASE" == "major" ]]; then
|
if [[ "$RELEASE" == "major" ]]; then
|
||||||
major=$((major + 1));
|
major=$((major + 1))
|
||||||
minor="0"
|
minor="0"
|
||||||
patch="0"
|
patch="0"
|
||||||
elif [[ "$RELEASE" == "minor" ]]; then
|
elif [[ "$RELEASE" == "minor" ]]; then
|
||||||
minor=$((minor + 1));
|
minor=$((minor + 1))
|
||||||
patch="0"
|
patch="0"
|
||||||
elif [[ "$RELEASE" == "patch" ]]; then
|
elif [[ "$RELEASE" == "patch" ]]; then
|
||||||
patch=$((patch + 1));
|
patch=$((patch + 1))
|
||||||
else
|
else
|
||||||
log-error "Invalid release type specified"
|
log-error "Invalid release type specified"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail; [[ $TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $TRACE ]] && set -x
|
||||||
|
|
||||||
if [[ -e /usr/share/debconf/confmodule ]]; then
|
if [[ -e /usr/share/debconf/confmodule ]]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
|
|||||||
Vendored
+6
-5
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail; [[ $TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $TRACE ]] && set -x
|
||||||
|
|
||||||
if [[ -e /usr/share/debconf/confmodule ]]; then
|
if [[ -e /usr/share/debconf/confmodule ]]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
@@ -26,9 +27,9 @@ call-sshcommand() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
abort-upgrade | abort-remove | abort-deconfigure) ;;
|
||||||
;;
|
|
||||||
|
|
||||||
|
\
|
||||||
configure)
|
configure)
|
||||||
mandb
|
mandb
|
||||||
[ ! -x /usr/bin/docker.io ] || ln -sf /usr/bin/docker.io /usr/local/bin/docker
|
[ ! -x /usr/bin/docker.io ] || ln -sf /usr/bin/docker.io /usr/local/bin/docker
|
||||||
@@ -55,7 +56,7 @@ case "$1" in
|
|||||||
elif [ -f ${DOKKU_LIB_ROOT}/plugins/$plugin/.core ]; then
|
elif [ -f ${DOKKU_LIB_ROOT}/plugins/$plugin/.core ]; then
|
||||||
rm -rf ${DOKKU_LIB_ROOT}/plugins/$plugin
|
rm -rf ${DOKKU_LIB_ROOT}/plugins/$plugin
|
||||||
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
||||||
mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available;
|
mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ case "$1" in
|
|||||||
echo "Skipping enable of nginx-vhosts plugin"
|
echo "Skipping enable of nginx-vhosts plugin"
|
||||||
continue
|
continue
|
||||||
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
||||||
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
|
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin
|
||||||
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin
|
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin
|
||||||
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
|
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
|
||||||
fi
|
fi
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail; [[ $TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $TRACE ]] && set -x
|
||||||
|
|
||||||
if [[ -e /usr/share/debconf/confmodule ]]; then
|
if [[ -e /usr/share/debconf/confmodule ]]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
|
|||||||
Vendored
+10
-6
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail; [[ $TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $TRACE ]] && set -x
|
||||||
|
|
||||||
if [[ -e /usr/share/debconf/confmodule ]]; then
|
if [[ -e /usr/share/debconf/confmodule ]]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
@@ -26,7 +27,10 @@ case "$1" in
|
|||||||
} >>$NGINX_CONF
|
} >>$NGINX_CONF
|
||||||
|
|
||||||
rm -f /etc/nginx/sites-enabled/*
|
rm -f /etc/nginx/sites-enabled/*
|
||||||
DOKKU_DISTRO="$(. /etc/os-release > /dev/null 2>&1 || true ; echo "$ID")"
|
DOKKU_DISTRO="$(
|
||||||
|
. /etc/os-release >/dev/null 2>&1 || true
|
||||||
|
echo "$ID"
|
||||||
|
)"
|
||||||
case "$DOKKU_DISTRO" in
|
case "$DOKKU_DISTRO" in
|
||||||
debian)
|
debian)
|
||||||
NGINX_INIT="/usr/sbin/invoke-rc.d"
|
NGINX_INIT="/usr/sbin/invoke-rc.d"
|
||||||
@@ -52,12 +56,12 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
upgrade)
|
upgrade) ;;
|
||||||
;;
|
|
||||||
|
|
||||||
abort-upgrade)
|
\
|
||||||
;;
|
abort-upgrade) ;;
|
||||||
|
|
||||||
|
\
|
||||||
*)
|
*)
|
||||||
echo "preinst called with unknown argument \`$1'" >&2
|
echo "preinst called with unknown argument \`$1'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Vendored
+14
-13
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail; [[ $TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $TRACE ]] && set -x
|
||||||
|
|
||||||
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
|
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
|
||||||
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
|
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
|
||||||
@@ -10,20 +11,20 @@ ps_backtrace() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -i pid=$1;
|
declare -i pid=$1
|
||||||
ppid=0;
|
ppid=0
|
||||||
header_modifier="";
|
header_modifier=""
|
||||||
while :; do
|
while :; do
|
||||||
if [ $ppid -ne 0 ]; then
|
if [ $ppid -ne 0 ]; then
|
||||||
header_modifier=h;
|
header_modifier=h
|
||||||
fi;
|
fi
|
||||||
ppid=$(ps -o ppid= $pid);
|
ppid=$(ps -o ppid= $pid)
|
||||||
ps uww $header_modifier -p $pid;
|
ps uww $header_modifier -p $pid
|
||||||
if [ $pid -eq 1 ]; then
|
if [ $pid -eq 1 ]; then
|
||||||
break;
|
break
|
||||||
fi;
|
fi
|
||||||
pid=$ppid;
|
pid=$ppid
|
||||||
done;
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
@@ -40,7 +41,7 @@ main() {
|
|||||||
echo "Disabling all core plugins"
|
echo "Disabling all core plugins"
|
||||||
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
||||||
if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
||||||
rm ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
|
rm ${DOKKU_LIB_ROOT}/plugins/available/$plugin
|
||||||
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn disable $plugin
|
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn disable $plugin
|
||||||
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn disable $plugin
|
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn disable $plugin
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ export DOKKU_HOST_ROOT=${DOKKU_HOST_ROOT:=$DOKKU_ROOT}
|
|||||||
|
|
||||||
export DOKKU_DISTRO
|
export DOKKU_DISTRO
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
DOKKU_DISTRO=$(. /etc/os-release > /dev/null 2>&1 || true ; echo "$ID")
|
DOKKU_DISTRO=$(
|
||||||
|
. /etc/os-release >/dev/null 2>&1 || true
|
||||||
|
echo "$ID"
|
||||||
|
)
|
||||||
|
|
||||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
|
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
|
||||||
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
||||||
@@ -112,7 +115,8 @@ execute_dokku_cmd() {
|
|||||||
declare desc="executes dokku sub-commands"
|
declare desc="executes dokku sub-commands"
|
||||||
local PLUGIN_NAME="$1"
|
local PLUGIN_NAME="$1"
|
||||||
local PLUGIN_CMD=$PLUGIN_NAME
|
local PLUGIN_CMD=$PLUGIN_NAME
|
||||||
local implemented=0; local script
|
local implemented=0
|
||||||
|
local script
|
||||||
local argv=("$@")
|
local argv=("$@")
|
||||||
|
|
||||||
case "$PLUGIN_NAME" in
|
case "$PLUGIN_NAME" in
|
||||||
@@ -156,7 +160,10 @@ execute_dokku_cmd() {
|
|||||||
|
|
||||||
if [[ $implemented -eq 0 ]]; then
|
if [[ $implemented -eq 0 ]]; then
|
||||||
for script in $PLUGIN_ENABLED_PATH/*/commands; do
|
for script in $PLUGIN_ENABLED_PATH/*/commands; do
|
||||||
set +e; $script "$@" ; exit_code=$? ; set -e
|
set +e
|
||||||
|
$script "$@"
|
||||||
|
exit_code=$?
|
||||||
|
set -e
|
||||||
if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
|
if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help help:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help help:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | run:help | trace:help | url:help | urls:help | version:help)
|
help | run:help | trace:help | url:help | urls:help | version:help)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
app_user_docker_args() {
|
app_user_docker_args() {
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
get_phase_script() {
|
get_phase_script() {
|
||||||
declare desc="extracts app.json from app image and returns the appropriate json key/value"
|
declare desc="extracts app.json from app image and returns the appropriate json key/value"
|
||||||
local IMAGE="$1"; local PHASE_SCRIPT_KEY="$2"
|
local IMAGE="$1"
|
||||||
|
local PHASE_SCRIPT_KEY="$2"
|
||||||
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_get_phase_script.XXXX")
|
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_get_phase_script.XXXX")
|
||||||
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
|
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
|
||||||
trap 'rm -rf "$GET_PHASE_SCRIPT_TMP_WORK_DIR" > /dev/null' RETURN INT TERM
|
trap 'rm -rf "$GET_PHASE_SCRIPT_TMP_WORK_DIR" > /dev/null' RETURN INT TERM
|
||||||
@@ -23,7 +25,9 @@ get_phase_script() {
|
|||||||
|
|
||||||
execute_script() {
|
execute_script() {
|
||||||
declare desc="executes appropriate phase script key from app.json"
|
declare desc="executes appropriate phase script key from app.json"
|
||||||
local APP="$1"; local IMAGE_TAG="$2"; local PHASE_SCRIPT_KEY="$3"
|
local APP="$1"
|
||||||
|
local IMAGE_TAG="$2"
|
||||||
|
local PHASE_SCRIPT_KEY="$3"
|
||||||
local IMAGE id
|
local IMAGE id
|
||||||
|
|
||||||
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
||||||
hostname -f >"$DOKKU_ROOT/HOSTNAME"
|
hostname -f >"$DOKKU_ROOT/HOSTNAME"
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
|
||||||
|
|
||||||
exec_app_json_scripts() {
|
exec_app_json_scripts() {
|
||||||
declare desc="core app.json scripts execution"
|
declare desc="core app.json scripts execution"
|
||||||
local trigger="post-deploy app_json_scripts"
|
local trigger="post-deploy app_json_scripts"
|
||||||
local APP="$1"; local IMAGE_TAG="$4"; local PHASE_SCRIPT_KEY="postdeploy"
|
local APP="$1"
|
||||||
|
local IMAGE_TAG="$4"
|
||||||
|
local PHASE_SCRIPT_KEY="postdeploy"
|
||||||
|
|
||||||
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
||||||
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
|
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
|
||||||
|
|
||||||
exec_app_json_scripts() {
|
exec_app_json_scripts() {
|
||||||
declare desc="core app.json scripts execution"
|
declare desc="core app.json scripts execution"
|
||||||
local trigger="pre-deploy app_json_scripts"
|
local trigger="pre-deploy app_json_scripts"
|
||||||
local APP="$1"; local IMAGE_TAG="$2"; local PHASE_SCRIPT_KEY="predeploy"
|
local APP="$1"
|
||||||
|
local IMAGE_TAG="$2"
|
||||||
|
local PHASE_SCRIPT_KEY="predeploy"
|
||||||
|
|
||||||
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
||||||
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
|
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
dokku_cleanup_cmd() {
|
dokku_cleanup_cmd() {
|
||||||
@@ -11,5 +12,4 @@ dokku_cleanup_cmd() {
|
|||||||
docker_cleanup "$APP" "true"
|
docker_cleanup "$APP" "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dokku_cleanup_cmd "$@"
|
dokku_cleanup_cmd "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
dokku_report_cmd() {
|
dokku_report_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
dokku_trace_cmd() {
|
dokku_trace_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
dokku_urls_cmd() {
|
dokku_urls_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
dokku_version_cmd() {
|
dokku_version_cmd() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help events:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help events:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | events:help)
|
help | events:help)
|
||||||
@@ -14,7 +15,7 @@ case "$1" in
|
|||||||
help_content
|
help_content
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $1 = "events:help" ]] ; then
|
if [[ $1 == "events:help" ]]; then
|
||||||
echo 'Usage: dokku events:COMMAND [-t]'
|
echo 'Usage: dokku events:COMMAND [-t]'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Interact with Dokku event logger.'
|
echo 'Interact with Dokku event logger.'
|
||||||
@@ -31,4 +32,3 @@ help_content
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename "$0")" "$@"
|
[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename "$0")" "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
DOKKU_RSYSLOG_FILTER_DIR=/etc/rsyslog.d
|
DOKKU_RSYSLOG_FILTER_DIR=/etc/rsyslog.d
|
||||||
@@ -59,7 +60,7 @@ $DOKKU_LOGS_DIR/*.log {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [[ "$DOKKU_DISTRO" = "debian" ]]; then
|
if [[ "$DOKKU_DISTRO" == "debian" ]]; then
|
||||||
sed -i 's/ syslog dokku$/ root dokku/g' $DOKKU_LOGROTATE_FILE
|
sed -i 's/ syslog dokku$/ root dokku/g' $DOKKU_LOGROTATE_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
events_main_cmd() {
|
events_main_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
events_list_cmd() {
|
events_list_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
events_off_cmd() {
|
events_off_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
events_on_cmd() {
|
events_on_cmd() {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help apps:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help apps:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | apps:help)
|
help | apps:help)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ apps_create() {
|
|||||||
|
|
||||||
apps_destroy() {
|
apps_destroy() {
|
||||||
declare desc="destroys an app"
|
declare desc="destroys an app"
|
||||||
declare APP="$1";
|
declare APP="$1"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
local IMAGE_TAG=$(get_running_image_tag "$APP")
|
local IMAGE_TAG=$(get_running_image_tag "$APP")
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-apps-report() {
|
cmd-apps-report() {
|
||||||
declare desc="displays the app report for one or more apps"
|
declare desc="displays the app report for one or more apps"
|
||||||
@@ -30,7 +31,7 @@ cmd-apps-report() {
|
|||||||
cmd-apps-report-single() {
|
cmd-apps-report-single() {
|
||||||
declare APP="$1" INFO_FLAG="$2"
|
declare APP="$1" INFO_FLAG="$2"
|
||||||
local APP_DIR="$DOKKU_ROOT/$APP"
|
local APP_DIR="$DOKKU_ROOT/$APP"
|
||||||
local use_echo;
|
local use_echo
|
||||||
if [[ "$INFO_FLAG" == "true" ]]; then
|
if [[ "$INFO_FLAG" == "true" ]]; then
|
||||||
use_echo=true
|
use_echo=true
|
||||||
INFO_FLAG=""
|
INFO_FLAG=""
|
||||||
@@ -58,7 +59,8 @@ cmd-apps-report-single() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
local match=false; local value_exists=false
|
local match=false
|
||||||
|
local value_exists=false
|
||||||
for flag in "${flag_map[@]}"; do
|
for flag in "${flag_map[@]}"; do
|
||||||
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
||||||
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
||||||
@@ -76,7 +78,6 @@ cmd-apps-report-single() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
apps_help_content_func() {
|
apps_help_content_func() {
|
||||||
declare desc="return apps plugin help content"
|
declare desc="return apps plugin help content"
|
||||||
cat <<help_content
|
cat <<help_content
|
||||||
@@ -94,7 +95,7 @@ help_content
|
|||||||
}
|
}
|
||||||
|
|
||||||
apps_help_cmd() {
|
apps_help_cmd() {
|
||||||
if [[ $1 = "apps:help" ]] ; then
|
if [[ $1 == "apps:help" ]]; then
|
||||||
echo -e 'Usage: dokku apps[:COMMAND]'
|
echo -e 'Usage: dokku apps[:COMMAND]'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Manage Dokku apps'
|
echo 'Manage Dokku apps'
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
app_post_delete() {
|
app_post_delete() {
|
||||||
declare desc="apps post-delete plugin trigger"
|
declare desc="apps post-delete plugin trigger"
|
||||||
local trigger="app_post_delete"
|
local trigger="app_post_delete"
|
||||||
local APP="$1"; local IMAGE_REPO=$(get_app_image_repo "$APP")
|
local APP="$1"
|
||||||
|
local IMAGE_REPO=$(get_app_image_repo "$APP")
|
||||||
if [[ -n $APP ]]; then
|
if [[ -n $APP ]]; then
|
||||||
# remove contents for apps that are symlinks to other folders
|
# remove contents for apps that are symlinks to other folders
|
||||||
rm -rf "${DOKKU_ROOT:?}/$APP/" >/dev/null
|
rm -rf "${DOKKU_ROOT:?}/$APP/" >/dev/null
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
apps_pre_delete() {
|
apps_pre_delete() {
|
||||||
declare desc="apps pre-delete plugin trigger"
|
declare desc="apps pre-delete plugin trigger"
|
||||||
local trigger="apps_pre_delete"
|
local trigger="apps_pre_delete"
|
||||||
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache"; local CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$APP/cache"
|
local APP="$1"
|
||||||
|
local IMAGE_TAG="$2"
|
||||||
|
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
|
local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||||
|
local CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$APP/cache"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
if ! is_image_herokuish_based "$IMAGE"; then
|
if ! is_image_herokuish_based "$IMAGE"; then
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-apps-report-single "$@"
|
cmd-apps-report-single "$@"
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||||
|
|
||||||
apps_clone_cmd() {
|
apps_clone_cmd() {
|
||||||
declare desc="clones an app"
|
declare desc="clones an app"
|
||||||
declare cmd="apps:clone" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
declare cmd="apps:clone" argv=("$@")
|
||||||
|
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
declare OLD_APP="$1" NEW_APP="$2"
|
declare OLD_APP="$1" NEW_APP="$2"
|
||||||
local IGNORE_EXISTING=false
|
local IGNORE_EXISTING=false
|
||||||
local SKIP_REBUILD=false
|
local SKIP_REBUILD=false
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||||
|
|
||||||
apps_create_cmd() {
|
apps_create_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
dokku_log_warn "Deprecated: Please use apps:list"
|
dokku_log_warn "Deprecated: Please use apps:list"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||||
|
|
||||||
apps_exists_cmd() {
|
apps_exists_cmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
apps_list_cmd "$@"
|
apps_list_cmd "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
@@ -7,7 +8,8 @@ apps_lock_cmd() {
|
|||||||
declare desc="locks an app for deployment"
|
declare desc="locks an app for deployment"
|
||||||
declare cmd="apps:lock"
|
declare cmd="apps:lock"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
declare APP="$1"; verify_app_name "$APP"
|
declare APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
|
|
||||||
touch "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to create deploy lock"
|
touch "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to create deploy lock"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
@@ -7,7 +8,8 @@ apps_locked_cmd() {
|
|||||||
declare desc="checks if an app is locked for deployment"
|
declare desc="checks if an app is locked for deployment"
|
||||||
declare cmd="apps:locked"
|
declare cmd="apps:locked"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
declare APP="$1"; verify_app_name "$APP"
|
declare APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local LOCKED="$(apps_is_locked "$APP")"
|
local LOCKED="$(apps_is_locked "$APP")"
|
||||||
|
|
||||||
if [[ "$LOCKED" != "true" ]]; then
|
if [[ "$LOCKED" != "true" ]]; then
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-apps-report "$@"
|
cmd-apps-report "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
@@ -7,7 +8,8 @@ apps_unlock_cmd() {
|
|||||||
declare desc="unlocks an app for deployment"
|
declare desc="unlocks an app for deployment"
|
||||||
declare cmd="apps:unlock"
|
declare cmd="apps:unlock"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
declare APP="$1"; verify_app_name "$APP"
|
declare APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
|
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/.deploy.lock" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/.deploy.lock" ]]; then
|
||||||
dokku_log_warn "A deploy may be in progress."
|
dokku_log_warn "A deploy may be in progress."
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ build_env_pre_build_buildpack() {
|
|||||||
local IMAGE id
|
local IMAGE id
|
||||||
|
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
IMAGE=$(get_app_image_name "$APP");
|
IMAGE=$(get_app_image_name "$APP")
|
||||||
|
|
||||||
[[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=90
|
[[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=90
|
||||||
[[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=600
|
[[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=600
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help certs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help certs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | certs:help)
|
help | certs:help)
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
is_ssl_enabled() {
|
is_ssl_enabled() {
|
||||||
declare desc="returns 0 if ssl is enabled for given app"
|
declare desc="returns 0 if ssl is enabled for given app"
|
||||||
local APP=$1; verify_app_name "$APP"
|
local APP=$1
|
||||||
|
verify_app_name "$APP"
|
||||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||||
|
|
||||||
if [[ -e "$APP_SSL_PATH/server.crt" ]] && [[ -e "$APP_SSL_PATH/server.key" ]]; then
|
if [[ -e "$APP_SSL_PATH/server.crt" ]] && [[ -e "$APP_SSL_PATH/server.key" ]]; then
|
||||||
@@ -16,7 +18,8 @@ is_ssl_enabled() {
|
|||||||
|
|
||||||
get_ssl_hostnames() {
|
get_ssl_hostnames() {
|
||||||
declare desc="returns a string of ssl hostnames extracted from an app's ssl certificate"
|
declare desc="returns a string of ssl hostnames extracted from an app's ssl certificate"
|
||||||
local APP=$1; verify_app_name "$APP"
|
local APP=$1
|
||||||
|
verify_app_name "$APP"
|
||||||
local SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
local SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||||
|
|
||||||
local SSL_HOSTNAME=$(openssl x509 -in "$SSL_PATH/server.crt" -noout -subject | tr '/' '\n' | grep CN= | cut -c4-)
|
local SSL_HOSTNAME=$(openssl x509 -in "$SSL_PATH/server.crt" -noout -subject | tr '/' '\n' | grep CN= | cut -c4-)
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-certs-report() {
|
cmd-certs-report() {
|
||||||
declare desc="displays an ssl report for one or more apps"
|
declare desc="displays an ssl report for one or more apps"
|
||||||
@@ -51,7 +52,8 @@ cmd-certs-report-single() {
|
|||||||
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
local match=false; local value_exists=false
|
local match=false
|
||||||
|
local value_exists=false
|
||||||
for flag in "${flag_map[@]}"; do
|
for flag in "${flag_map[@]}"; do
|
||||||
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
||||||
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
||||||
@@ -86,7 +88,7 @@ help_content
|
|||||||
}
|
}
|
||||||
|
|
||||||
certs_help_cmd() {
|
certs_help_cmd() {
|
||||||
if [[ $1 = "certs:help" ]] ; then
|
if [[ $1 == "certs:help" ]]; then
|
||||||
echo -e 'Usage: dokku certs[:COMMAND]'
|
echo -e 'Usage: dokku certs[:COMMAND]'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Manage Dokku apps SSL (TLS) certs.'
|
echo 'Manage Dokku apps SSL (TLS) certs.'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
certs_post_app_clone_setup() {
|
certs_post_app_clone_setup() {
|
||||||
declare desc="removes cert file when setting up a clone"
|
declare desc="removes cert file when setting up a clone"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-certs-report-single "$@"
|
cmd-certs-report-single "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||||
|
|
||||||
@@ -32,8 +33,10 @@ certs_set() {
|
|||||||
local cmd="$1"
|
local cmd="$1"
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
verify_app_name "$2"
|
verify_app_name "$2"
|
||||||
local APP="$2"; local CRT_FILE="$3"; local KEY_FILE="$4"; local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
local APP="$2"
|
||||||
|
local CRT_FILE="$3"
|
||||||
|
local KEY_FILE="$4"
|
||||||
|
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||||
|
|
||||||
if is_file_import "$CRT_FILE" "$KEY_FILE"; then
|
if is_file_import "$CRT_FILE" "$KEY_FILE"; then
|
||||||
# importing from file
|
# importing from file
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
||||||
|
|
||||||
dokku_log_warn "Deprecated: Please use certs:report"
|
dokku_log_warn "Deprecated: Please use certs:report"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
||||||
|
|
||||||
dokku_log_warn "Deprecated: Please use certs:report"
|
dokku_log_warn "Deprecated: Please use certs:report"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
certs_remove_cmd() {
|
certs_remove_cmd() {
|
||||||
@@ -7,7 +8,8 @@ certs_remove_cmd() {
|
|||||||
local cmd="certs:remove"
|
local cmd="certs:remove"
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
verify_app_name "$2"
|
verify_app_name "$2"
|
||||||
local APP="$2"; local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
local APP="$2"
|
||||||
|
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||||
|
|
||||||
if [[ -d "$APP_SSL_PATH" ]]; then
|
if [[ -d "$APP_SSL_PATH" ]]; then
|
||||||
dokku_log_info1 "Removing SSL endpoint from $APP"
|
dokku_log_info1 "Removing SSL endpoint from $APP"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-certs-report "$@"
|
cmd-certs-report "$@"
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help checks:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help checks:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | checks:help)
|
help | checks:help)
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
is_app_proctype_checks_disabled() {
|
is_app_proctype_checks_disabled() {
|
||||||
declare desc="return true if app's proctype(s) checks are disabled"
|
declare desc="return true if app's proctype(s) checks are disabled"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local PROCTYPE="$2" status=false
|
local PROCTYPE="$2" status=false
|
||||||
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
||||||
|
|
||||||
@@ -18,7 +20,8 @@ is_app_proctype_checks_disabled() {
|
|||||||
|
|
||||||
is_app_proctype_checks_skipped() {
|
is_app_proctype_checks_skipped() {
|
||||||
declare desc="return true if app's proctype(s) checks are skipped"
|
declare desc="return true if app's proctype(s) checks are skipped"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local PROCTYPE="$2" status=false
|
local PROCTYPE="$2" status=false
|
||||||
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-checks-report() {
|
cmd-checks-report() {
|
||||||
declare desc="shows reports for an app"
|
declare desc="shows reports for an app"
|
||||||
@@ -45,7 +46,8 @@ cmd-checks-report-single() {
|
|||||||
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
local match=false; local value_exists=false
|
local match=false
|
||||||
|
local value_exists=false
|
||||||
for flag in "${flag_map[@]}"; do
|
for flag in "${flag_map[@]}"; do
|
||||||
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
||||||
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
||||||
@@ -76,7 +78,7 @@ help_content
|
|||||||
}
|
}
|
||||||
|
|
||||||
checks_help_cmd() {
|
checks_help_cmd() {
|
||||||
if [[ $1 = "checks:help" ]] ; then
|
if [[ $1 == "checks:help" ]]; then
|
||||||
echo -e 'Usage: dokku checks[:COMMAND]'
|
echo -e 'Usage: dokku checks[:COMMAND]'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Manage zero-downtime settings.'
|
echo 'Manage zero-downtime settings.'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-checks-report-single "$@"
|
cmd-checks-report-single "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||||
|
|
||||||
@@ -7,7 +8,8 @@ checks_disable_cmd() {
|
|||||||
declare desc="disable zero-downtime checks for app/proctypes"
|
declare desc="disable zero-downtime checks for app/proctypes"
|
||||||
local cmd="checks:disable"
|
local cmd="checks:disable"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local PROCTYPES="${2:-_all_}"
|
local PROCTYPES="${2:-_all_}"
|
||||||
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
||||||
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
||||||
@@ -21,10 +23,10 @@ checks_disable_cmd() {
|
|||||||
local PROCTYPE OIFS="$IFS" IFS=,
|
local PROCTYPE OIFS="$IFS" IFS=,
|
||||||
for PROCTYPE in $PROCTYPES; do
|
for PROCTYPE in $PROCTYPES; do
|
||||||
IFS="$OIFS"
|
IFS="$OIFS"
|
||||||
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")" == "false" ]] && \
|
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")" == "false" ]] \
|
||||||
DOKKU_CHECKS_DISABLED="$(add_val_to_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")"
|
&& DOKKU_CHECKS_DISABLED="$(add_val_to_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")"
|
||||||
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")" == "true" ]] && \
|
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")" == "true" ]] \
|
||||||
DOKKU_CHECKS_SKIPPED="$(remove_val_from_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")"
|
&& DOKKU_CHECKS_SKIPPED="$(remove_val_from_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")"
|
||||||
done
|
done
|
||||||
DOKKU_CHECKS_DISABLED="$(remove_val_from_list "_all_" "$DOKKU_CHECKS_DISABLED")"
|
DOKKU_CHECKS_DISABLED="$(remove_val_from_list "_all_" "$DOKKU_CHECKS_DISABLED")"
|
||||||
if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then
|
if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||||
|
|
||||||
@@ -7,7 +8,8 @@ checks_enable_cmd() {
|
|||||||
declare desc="enable zero-downtime checks for app/proctypes"
|
declare desc="enable zero-downtime checks for app/proctypes"
|
||||||
local cmd="checks:enable"
|
local cmd="checks:enable"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local PROCTYPES="${2:-_all_}"
|
local PROCTYPES="${2:-_all_}"
|
||||||
|
|
||||||
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-checks-report "$@"
|
cmd-checks-report "$@"
|
||||||
@@ -1,14 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||||
|
|
||||||
check_all_processes() {
|
check_all_processes() {
|
||||||
local APP="$1"; CHECK_PROC_TYPE="$2"
|
local APP="$1"
|
||||||
|
CHECK_PROC_TYPE="$2"
|
||||||
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||||
local VALID_CHECK_PROC_TYPE=false
|
local VALID_CHECK_PROC_TYPE=false
|
||||||
|
|
||||||
local line; local PROC_TYPE; local PROC_COUNT
|
local line
|
||||||
|
local PROC_TYPE
|
||||||
|
local PROC_COUNT
|
||||||
while read -r line || [[ -n "$line" ]]; do
|
while read -r line || [[ -n "$line" ]]; do
|
||||||
[[ "$line" =~ ^#.* ]] && continue
|
[[ "$line" =~ ^#.* ]] && continue
|
||||||
line="$(strip_inline_comments "$line")"
|
line="$(strip_inline_comments "$line")"
|
||||||
@@ -67,7 +71,8 @@ checks_run_cmd() {
|
|||||||
declare desc="run zero-downtime checks for app/proctypes"
|
declare desc="run zero-downtime checks for app/proctypes"
|
||||||
local cmd="checks:run"
|
local cmd="checks:run"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local PROCTYPES="${2:-_all_}"
|
local PROCTYPES="${2:-_all_}"
|
||||||
|
|
||||||
dokku_log_info1 "Running pre-flight checks"
|
dokku_log_info1 "Running pre-flight checks"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||||
|
|
||||||
@@ -7,7 +8,8 @@ checks_skip_cmd() {
|
|||||||
declare desc="skip zero-downtime checks for app/proctypes"
|
declare desc="skip zero-downtime checks for app/proctypes"
|
||||||
local cmd="checks:skip"
|
local cmd="checks:skip"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local PROCTYPES="${2:-_all_}"
|
local PROCTYPES="${2:-_all_}"
|
||||||
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
||||||
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
||||||
@@ -21,10 +23,10 @@ checks_skip_cmd() {
|
|||||||
local PROCTYPE OIFS="$IFS" IFS=,
|
local PROCTYPE OIFS="$IFS" IFS=,
|
||||||
for PROCTYPE in $PROCTYPES; do
|
for PROCTYPE in $PROCTYPES; do
|
||||||
IFS="$OIFS"
|
IFS="$OIFS"
|
||||||
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")" == "false" ]] && \
|
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")" == "false" ]] \
|
||||||
DOKKU_CHECKS_SKIPPED="$(add_val_to_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")"
|
&& DOKKU_CHECKS_SKIPPED="$(add_val_to_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")"
|
||||||
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")" == "true" ]] && \
|
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")" == "true" ]] \
|
||||||
DOKKU_CHECKS_DISABLED="$(remove_val_from_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")"
|
&& DOKKU_CHECKS_DISABLED="$(remove_val_from_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")"
|
||||||
done
|
done
|
||||||
DOKKU_CHECKS_SKIPPED="$(remove_val_from_list "_all_" "$DOKKU_CHECKS_SKIPPED")"
|
DOKKU_CHECKS_SKIPPED="$(remove_val_from_list "_all_" "$DOKKU_CHECKS_SKIPPED")"
|
||||||
if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then
|
if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then
|
||||||
|
|||||||
+70
-30
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
has_tty() {
|
has_tty() {
|
||||||
declare desc="return 0 if we have a tty"
|
declare desc="return 0 if we have a tty"
|
||||||
@@ -129,13 +130,14 @@ dokku_log_event() {
|
|||||||
dokku_log_plugn_trigger_call() {
|
dokku_log_plugn_trigger_call() {
|
||||||
declare desc="log plugn trigger calls"
|
declare desc="log plugn trigger calls"
|
||||||
|
|
||||||
local l_hook="$1" ; shift
|
local l_hook="$1"
|
||||||
|
shift
|
||||||
dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT"
|
dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT"
|
||||||
}
|
}
|
||||||
|
|
||||||
dokku_container_log_verbose_quiet() {
|
dokku_container_log_verbose_quiet() {
|
||||||
declare desc="log verbose container output (with quiet option)"
|
declare desc="log verbose container output (with quiet option)"
|
||||||
local CID=$1;
|
local CID=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
@@ -182,14 +184,17 @@ verify_image() {
|
|||||||
|
|
||||||
get_app_image_repo() {
|
get_app_image_repo() {
|
||||||
declare desc="central definition of image repo pattern"
|
declare desc="central definition of image repo pattern"
|
||||||
local APP="$1"; local IMAGE_REPO="dokku/$APP"
|
local APP="$1"
|
||||||
|
local IMAGE_REPO="dokku/$APP"
|
||||||
is_valid_app_name "$APP"
|
is_valid_app_name "$APP"
|
||||||
echo "$IMAGE_REPO"
|
echo "$IMAGE_REPO"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_deploying_app_image_name() {
|
get_deploying_app_image_name() {
|
||||||
declare desc="return deploying image identifier for a given app, tag tuple. validate if tag is presented"
|
declare desc="return deploying image identifier for a given app, tag tuple. validate if tag is presented"
|
||||||
local APP="$1"; local IMAGE_TAG="$2"; IMAGE_REPO="$3"
|
local APP="$1"
|
||||||
|
local IMAGE_TAG="$2"
|
||||||
|
IMAGE_REPO="$3"
|
||||||
is_valid_app_name "$APP"
|
is_valid_app_name "$APP"
|
||||||
|
|
||||||
local IMAGE_REMOTE_REPOSITORY=$(plugn trigger deployed-app-repository "$APP")
|
local IMAGE_REMOTE_REPOSITORY=$(plugn trigger deployed-app-repository "$APP")
|
||||||
@@ -208,7 +213,9 @@ get_deploying_app_image_name() {
|
|||||||
|
|
||||||
get_app_image_name() {
|
get_app_image_name() {
|
||||||
declare desc="return image identifier for a given app, tag tuple. validate if tag is presented"
|
declare desc="return image identifier for a given app, tag tuple. validate if tag is presented"
|
||||||
local APP="$1"; local IMAGE_TAG="$2"; IMAGE_REPO="$3"
|
local APP="$1"
|
||||||
|
local IMAGE_TAG="$2"
|
||||||
|
IMAGE_REPO="$3"
|
||||||
is_valid_app_name "$APP"
|
is_valid_app_name "$APP"
|
||||||
|
|
||||||
if [[ -z "$IMAGE_REPO" ]]; then
|
if [[ -z "$IMAGE_REPO" ]]; then
|
||||||
@@ -264,7 +271,8 @@ get_docker_version() {
|
|||||||
|
|
||||||
is_number() {
|
is_number() {
|
||||||
declare desc="returns 0 if input is a number"
|
declare desc="returns 0 if input is a number"
|
||||||
local NUMBER=$1; local NUM_RE='^[0-9]+$'
|
local NUMBER=$1
|
||||||
|
local NUM_RE='^[0-9]+$'
|
||||||
if [[ $NUMBER =~ $NUM_RE ]]; then
|
if [[ $NUMBER =~ $NUM_RE ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
@@ -284,7 +292,9 @@ is_abs_path() {
|
|||||||
|
|
||||||
parse_args() {
|
parse_args() {
|
||||||
declare desc="top-level cli arg parser"
|
declare desc="top-level cli arg parser"
|
||||||
local next_index=1; local skip=false; local args=("$@")
|
local next_index=1
|
||||||
|
local skip=false
|
||||||
|
local args=("$@")
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [[ "$skip" == "true" ]]; then
|
if [[ "$skip" == "true" ]]; then
|
||||||
next_index=$((next_index + 1))
|
next_index=$((next_index + 1))
|
||||||
@@ -309,7 +319,8 @@ parse_args() {
|
|||||||
export DOKKU_APPS_FORCE_DELETE=1
|
export DOKKU_APPS_FORCE_DELETE=1
|
||||||
;;
|
;;
|
||||||
--app)
|
--app)
|
||||||
export DOKKU_APP_NAME=${args[$next_index]}; skip=true
|
export DOKKU_APP_NAME=${args[$next_index]}
|
||||||
|
skip=true
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
next_index=$((next_index + 1))
|
next_index=$((next_index + 1))
|
||||||
@@ -319,7 +330,9 @@ parse_args() {
|
|||||||
|
|
||||||
copy_from_image() {
|
copy_from_image() {
|
||||||
declare desc="copy file from named image to destination"
|
declare desc="copy file from named image to destination"
|
||||||
local IMAGE="$1"; local SRC_FILE="$2"; local DST_DIR="$3"
|
local IMAGE="$1"
|
||||||
|
local SRC_FILE="$2"
|
||||||
|
local DST_DIR="$3"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
if verify_image "$IMAGE"; then
|
if verify_image "$IMAGE"; then
|
||||||
@@ -338,7 +351,8 @@ copy_from_image() {
|
|||||||
|
|
||||||
get_app_container_ids() {
|
get_app_container_ids() {
|
||||||
declare desc="returns list of docker container ids for given app and optional container_type"
|
declare desc="returns list of docker container ids for given app and optional container_type"
|
||||||
local APP="$1"; local CONTAINER_TYPE="$2"
|
local APP="$1"
|
||||||
|
local CONTAINER_TYPE="$2"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
[[ -f $DOKKU_ROOT/$APP/CONTAINER ]] && DOKKU_CIDS+=$(<"$DOKKU_ROOT/$APP/CONTAINER")
|
[[ -f $DOKKU_ROOT/$APP/CONTAINER ]] && DOKKU_CIDS+=$(<"$DOKKU_ROOT/$APP/CONTAINER")
|
||||||
|
|
||||||
@@ -398,7 +412,10 @@ get_app_running_container_types() {
|
|||||||
is_deployed() {
|
is_deployed() {
|
||||||
declare desc="return 0 if given app has a running container"
|
declare desc="return 0 if given app has a running container"
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] || [[ $(ls "$DOKKU_ROOT/$APP"/CONTAINER.* &> /dev/null; echo $?) -eq 0 ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] || [[ $(
|
||||||
|
ls "$DOKKU_ROOT/$APP"/CONTAINER.* &>/dev/null
|
||||||
|
echo $?
|
||||||
|
) -eq 0 ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -455,7 +472,10 @@ dokku_build() {
|
|||||||
declare desc="build phase"
|
declare desc="build phase"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP="$1"; local IMAGE_SOURCE_TYPE="$2"; local TMP_WORK_DIR="$3"; local IMAGE=$(get_app_image_name "$APP")
|
local APP="$1"
|
||||||
|
local IMAGE_SOURCE_TYPE="$2"
|
||||||
|
local TMP_WORK_DIR="$3"
|
||||||
|
local IMAGE=$(get_app_image_name "$APP")
|
||||||
local cid
|
local cid
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
@@ -522,7 +542,10 @@ dokku_release() {
|
|||||||
declare desc="release phase"
|
declare desc="release phase"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP="$1"; local IMAGE_SOURCE_TYPE="$2"; local IMAGE_TAG="$3"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
local APP="$1"
|
||||||
|
local IMAGE_SOURCE_TYPE="$2"
|
||||||
|
local IMAGE_TAG="$3"
|
||||||
|
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
local cid
|
local cid
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
@@ -567,7 +590,9 @@ release_and_deploy() {
|
|||||||
declare desc="main function for releasing and deploying an app"
|
declare desc="main function for releasing and deploying an app"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
local APP="$1"
|
||||||
|
local IMAGE_TAG="$2"
|
||||||
|
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
local DOKKU_DOCKERFILE_PORTS
|
local DOKKU_DOCKERFILE_PORTS
|
||||||
|
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
@@ -609,7 +634,10 @@ dokku_receive() {
|
|||||||
declare desc="receives an app kicks off deploy process"
|
declare desc="receives an app kicks off deploy process"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP="$1"; local IMAGE=$(get_app_image_name "$APP"); local IMAGE_SOURCE_TYPE="$2"; local TMP_WORK_DIR="$3"
|
local APP="$1"
|
||||||
|
local IMAGE=$(get_app_image_name "$APP")
|
||||||
|
local IMAGE_SOURCE_TYPE="$2"
|
||||||
|
local TMP_WORK_DIR="$3"
|
||||||
local DOKKU_SKIP_CLEANUP="$(config_get "$APP" DOKKU_SKIP_CLEANUP || true)"
|
local DOKKU_SKIP_CLEANUP="$(config_get "$APP" DOKKU_SKIP_CLEANUP || true)"
|
||||||
docker_cleanup "$APP"
|
docker_cleanup "$APP"
|
||||||
dokku_log_info1 "Building $APP from $IMAGE_SOURCE_TYPE..."
|
dokku_log_info1 "Building $APP from $IMAGE_SOURCE_TYPE..."
|
||||||
@@ -719,7 +747,8 @@ get_dockerfile_exposed_ports() {
|
|||||||
|
|
||||||
get_exposed_ports_from_image() {
|
get_exposed_ports_from_image() {
|
||||||
declare desc="return all exposed ports from passed image name"
|
declare desc="return all exposed ports from passed image name"
|
||||||
local IMAGE="$1"; verify_image "$IMAGE"
|
local IMAGE="$1"
|
||||||
|
verify_image "$IMAGE"
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
local DOCKER_IMAGE_EXPOSED_PORTS="$(docker inspect -f '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE")"
|
local DOCKER_IMAGE_EXPOSED_PORTS="$(docker inspect -f '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE")"
|
||||||
echo "$DOCKER_IMAGE_EXPOSED_PORTS"
|
echo "$DOCKER_IMAGE_EXPOSED_PORTS"
|
||||||
@@ -727,14 +756,16 @@ get_exposed_ports_from_image() {
|
|||||||
|
|
||||||
get_entrypoint_from_image() {
|
get_entrypoint_from_image() {
|
||||||
declare desc="return .Config.Entrypoint from passed image name"
|
declare desc="return .Config.Entrypoint from passed image name"
|
||||||
local IMAGE="$1"; verify_image "$IMAGE"
|
local IMAGE="$1"
|
||||||
|
verify_image "$IMAGE"
|
||||||
local DOCKER_IMAGE_ENTRYPOINT="$(docker inspect --format '{{range .Config.Entrypoint}}{{.}} {{end}}' "$IMAGE")"
|
local DOCKER_IMAGE_ENTRYPOINT="$(docker inspect --format '{{range .Config.Entrypoint}}{{.}} {{end}}' "$IMAGE")"
|
||||||
echo "ENTRYPOINT $DOCKER_IMAGE_ENTRYPOINT"
|
echo "ENTRYPOINT $DOCKER_IMAGE_ENTRYPOINT"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cmd_from_image() {
|
get_cmd_from_image() {
|
||||||
declare desc="return .Config.Cmd from passed image name"
|
declare desc="return .Config.Cmd from passed image name"
|
||||||
local IMAGE="$1"; verify_image "$IMAGE"
|
local IMAGE="$1"
|
||||||
|
verify_image "$IMAGE"
|
||||||
local DOCKER_IMAGE_CMD="$(docker inspect --format '{{range .Config.Cmd}}{{.}} {{end}}' "$IMAGE")"
|
local DOCKER_IMAGE_CMD="$(docker inspect --format '{{range .Config.Cmd}}{{.}} {{end}}' "$IMAGE")"
|
||||||
DOCKER_IMAGE_CMD="${DOCKER_IMAGE_CMD/\/bin\/sh -c/}"
|
DOCKER_IMAGE_CMD="${DOCKER_IMAGE_CMD/\/bin\/sh -c/}"
|
||||||
echo "CMD $DOCKER_IMAGE_CMD"
|
echo "CMD $DOCKER_IMAGE_CMD"
|
||||||
@@ -742,7 +773,8 @@ get_cmd_from_image() {
|
|||||||
|
|
||||||
extract_directive_from_dockerfile() {
|
extract_directive_from_dockerfile() {
|
||||||
declare desc="return requested directive from passed file path"
|
declare desc="return requested directive from passed file path"
|
||||||
local FILE_PATH="$1"; local SEARCH_STRING="$2"
|
local FILE_PATH="$1"
|
||||||
|
local SEARCH_STRING="$2"
|
||||||
local FOUND_LINE=$(egrep "^${SEARCH_STRING} " "$FILE_PATH" | tail -n1) || true
|
local FOUND_LINE=$(egrep "^${SEARCH_STRING} " "$FILE_PATH" | tail -n1) || true
|
||||||
echo "$FOUND_LINE"
|
echo "$FOUND_LINE"
|
||||||
}
|
}
|
||||||
@@ -751,11 +783,12 @@ get_app_raw_tcp_ports() {
|
|||||||
declare desc="extracts raw tcp port numbers from DOCKERFILE_PORTS config variable"
|
declare desc="extracts raw tcp port numbers from DOCKERFILE_PORTS config variable"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local DOCKERFILE_PORTS="$(config_get "$APP" DOKKU_DOCKERFILE_PORTS)"
|
local DOCKERFILE_PORTS="$(config_get "$APP" DOKKU_DOCKERFILE_PORTS)"
|
||||||
for p in $DOCKERFILE_PORTS; do
|
for p in $DOCKERFILE_PORTS; do
|
||||||
if [[ ! "$p" =~ .*udp.* ]]; then
|
if [[ ! "$p" =~ .*udp.* ]]; then
|
||||||
p=${p//\/tcp}
|
p=${p//\/tcp/}
|
||||||
raw_tcp_ports+="$p "
|
raw_tcp_ports+="$p "
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -765,7 +798,8 @@ get_app_raw_tcp_ports() {
|
|||||||
|
|
||||||
get_container_ports() {
|
get_container_ports() {
|
||||||
declare desc="returns published ports from app containers"
|
declare desc="returns published ports from app containers"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local APP_CIDS="$(get_app_container_ids "$APP")"
|
local APP_CIDS="$(get_app_container_ids "$APP")"
|
||||||
local cid
|
local cid
|
||||||
|
|
||||||
@@ -834,7 +868,8 @@ internal_get_app_urls() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
local SCHEME="http"; local SSL="$DOKKU_ROOT/$APP/tls"
|
local SCHEME="http"
|
||||||
|
local SSL="$DOKKU_ROOT/$APP/tls"
|
||||||
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]]; then
|
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]]; then
|
||||||
local SCHEME="https"
|
local SCHEME="https"
|
||||||
fi
|
fi
|
||||||
@@ -879,7 +914,7 @@ get_json_value() {
|
|||||||
local JSON_NODE="$1"
|
local JSON_NODE="$1"
|
||||||
local JSON_NODE=${JSON_NODE//\./\"][\"}
|
local JSON_NODE=${JSON_NODE//\./\"][\"}
|
||||||
local JSON_NODE="[\"${JSON_NODE}\"]"
|
local JSON_NODE="[\"${JSON_NODE}\"]"
|
||||||
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj'"${JSON_NODE}"').strip("\"")';
|
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj'"${JSON_NODE}"').strip("\"")'
|
||||||
}
|
}
|
||||||
|
|
||||||
get_json_keys() {
|
get_json_keys() {
|
||||||
@@ -889,9 +924,9 @@ get_json_keys() {
|
|||||||
local JSON_NODE=${JSON_NODE//\./\"][\"}
|
local JSON_NODE=${JSON_NODE//\./\"][\"}
|
||||||
local JSON_NODE="[\"${JSON_NODE}\"]"
|
local JSON_NODE="[\"${JSON_NODE}\"]"
|
||||||
if [[ "$JSON_NODE" == "[\"\"]" ]]; then
|
if [[ "$JSON_NODE" == "[\"\"]" ]]; then
|
||||||
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj.keys())';
|
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj.keys())'
|
||||||
else
|
else
|
||||||
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj'"${JSON_NODE}"'.keys())';
|
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj'"${JSON_NODE}"'.keys())'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,7 +979,8 @@ merge_dedupe_list() {
|
|||||||
|
|
||||||
acquire_app_deploy_lock() {
|
acquire_app_deploy_lock() {
|
||||||
declare desc="acquire advisory lock for use in git/tar deploys"
|
declare desc="acquire advisory lock for use in git/tar deploys"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local LOCK_TYPE="${2:-waiting}"
|
local LOCK_TYPE="${2:-waiting}"
|
||||||
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
||||||
local LOCK_WAITING_MSG="$APP currently has a deploy lock in place. Waiting..."
|
local LOCK_WAITING_MSG="$APP currently has a deploy lock in place. Waiting..."
|
||||||
@@ -955,7 +991,8 @@ acquire_app_deploy_lock() {
|
|||||||
|
|
||||||
release_app_deploy_lock() {
|
release_app_deploy_lock() {
|
||||||
declare desc="release advisory lock used in git/tar deploys"
|
declare desc="release advisory lock used in git/tar deploys"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
||||||
|
|
||||||
release_advisory_lock "$APP_DEPLOY_LOCK_FILE"
|
release_advisory_lock "$APP_DEPLOY_LOCK_FILE"
|
||||||
@@ -969,7 +1006,10 @@ acquire_advisory_lock() {
|
|||||||
|
|
||||||
eval "exec $LOCK_FD>$LOCK_FILE"
|
eval "exec $LOCK_FD>$LOCK_FILE"
|
||||||
if [[ "$LOCK_TYPE" == "waiting" ]]; then
|
if [[ "$LOCK_TYPE" == "waiting" ]]; then
|
||||||
while [[ $(flock -n "$LOCK_FD" &>/dev/null ; echo $?) -ne 0 ]]; do
|
while [[ $(
|
||||||
|
flock -n "$LOCK_FD" &>/dev/null
|
||||||
|
echo $?
|
||||||
|
) -ne 0 ]]; do
|
||||||
if [[ "$SHOW_MSG" == "true" ]]; then
|
if [[ "$SHOW_MSG" == "true" ]]; then
|
||||||
echo "$LOCK_WAITING_MSG"
|
echo "$LOCK_WAITING_MSG"
|
||||||
SHOW_MSG=false
|
SHOW_MSG=false
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
fn-plugin-property-delete() {
|
fn-plugin-property-delete() {
|
||||||
declare desc="delete a key from the property store for an app"
|
declare desc="delete a key from the property store for an app"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
@@ -9,7 +10,7 @@ config_docker_args() {
|
|||||||
local ENV_ARGS IMAGE STDIN trigger
|
local ENV_ARGS IMAGE STDIN trigger
|
||||||
|
|
||||||
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
STDIN=$(cat);
|
STDIN=$(cat)
|
||||||
trigger="$0 config_docker_args"
|
trigger="$0 config_docker_args"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
config_sub() {
|
config_sub() {
|
||||||
@@ -23,7 +24,6 @@ config_export() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
config_all() {
|
config_all() {
|
||||||
declare desc="Backwards compatible function for plugin use"
|
declare desc="Backwards compatible function for plugin use"
|
||||||
[[ "$1" == "config" ]] || set -- "config" "$@"
|
[[ "$1" == "config" ]] || set -- "config" "$@"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help docker-options:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help docker-options:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
docker_options_help_content_func() {
|
docker_options_help_content_func() {
|
||||||
declare desc="return docker-options plugin help content"
|
declare desc="return docker-options plugin help content"
|
||||||
@@ -13,7 +14,7 @@ help_content
|
|||||||
}
|
}
|
||||||
|
|
||||||
docker_options_help_cmd() {
|
docker_options_help_cmd() {
|
||||||
if [[ $1 = "docker-options:help" ]] ; then
|
if [[ $1 == "docker-options:help" ]]; then
|
||||||
echo -e 'Usage: dokku docker-options[:COMMAND]'
|
echo -e 'Usage: dokku docker-options[:COMMAND]'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Display app'"'"'s Docker options for all phases.'
|
echo 'Display app'"'"'s Docker options for all phases.'
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
docker_args() {
|
docker_args() {
|
||||||
declare desc="docker args plugin trigger"
|
declare desc="docker args plugin trigger"
|
||||||
local trigger="$0"
|
local trigger="$0"
|
||||||
local STDIN=$(cat)
|
local STDIN=$(cat)
|
||||||
local APP="$1"; local IMAGE_SOURCE_TYPE="$2"
|
local APP="$1"
|
||||||
|
local IMAGE_SOURCE_TYPE="$2"
|
||||||
|
|
||||||
case "$0" in
|
case "$0" in
|
||||||
*docker-args-build)
|
*docker-args-build)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
AVAILABLE_PHASES=(build deploy run)
|
AVAILABLE_PHASES=(build deploy run)
|
||||||
@@ -26,11 +27,12 @@ get_phases() {
|
|||||||
local phase
|
local phase
|
||||||
local passed_phases
|
local passed_phases
|
||||||
if [[ -n "$passed_phases_list" ]]; then
|
if [[ -n "$passed_phases_list" ]]; then
|
||||||
OIFS=$IFS; IFS=','
|
OIFS=$IFS
|
||||||
|
IFS=','
|
||||||
read -ra passed_phases <<<"$passed_phases_list"
|
read -ra passed_phases <<<"$passed_phases_list"
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
for phase in "${passed_phases[@]}"; do
|
for phase in "${passed_phases[@]}"; do
|
||||||
[[ "$phase" = @($phases_allowed) ]] || dokku_log_fail "Phase(s) must be one of [${AVAILABLE_PHASES[*]}]"
|
[[ "$phase" == @($phases_allowed) ]] || dokku_log_fail "Phase(s) must be one of [${AVAILABLE_PHASES[*]}]"
|
||||||
done
|
done
|
||||||
echo "${passed_phases[@]}"
|
echo "${passed_phases[@]}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-docker-options-report() {
|
cmd-docker-options-report() {
|
||||||
declare desc="displays a docker options report for one or more apps"
|
declare desc="displays a docker options report for one or more apps"
|
||||||
@@ -46,7 +47,8 @@ cmd-docker-options-report-single() {
|
|||||||
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
local match=false; local value_exists=false
|
local match=false
|
||||||
|
local value_exists=false
|
||||||
for flag in "${flag_map[@]}"; do
|
for flag in "${flag_map[@]}"; do
|
||||||
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
||||||
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/docker-options/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-docker-options-report-single "$@"
|
cmd-docker-options-report-single "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/docker-options/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-docker-options-report "$@"
|
cmd-docker-options-report "$@"
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help domains:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help domains:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | domains:help)
|
help | domains:help)
|
||||||
|
|||||||
+38
-17
@@ -1,12 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
disable_app_vhost() {
|
disable_app_vhost() {
|
||||||
declare desc="disable vhost support for given application"
|
declare desc="disable vhost support for given application"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP=$1; verify_app_name "$APP"
|
local APP=$1
|
||||||
|
verify_app_name "$APP"
|
||||||
local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST"
|
local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST"
|
||||||
local APP_URLS_FILE="$DOKKU_ROOT/$APP/URLS"
|
local APP_URLS_FILE="$DOKKU_ROOT/$APP/URLS"
|
||||||
|
|
||||||
@@ -28,8 +30,11 @@ disable_app_vhost() {
|
|||||||
domains_setup() {
|
domains_setup() {
|
||||||
declare desc="setup domains to default state"
|
declare desc="setup domains to default state"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"; local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
local APP="$1"
|
||||||
local RE_IPV4="$(get_ipv4_regex)"; local RE_IPV6="$(get_ipv6_regex)"
|
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
|
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||||
|
local RE_IPV4="$(get_ipv4_regex)"
|
||||||
|
local RE_IPV6="$(get_ipv6_regex)"
|
||||||
local DEFAULT_VHOSTS="$(get_default_vhosts "$APP")"
|
local DEFAULT_VHOSTS="$(get_default_vhosts "$APP")"
|
||||||
|
|
||||||
if [[ ! -f $APP_VHOST_PATH ]]; then
|
if [[ ! -f $APP_VHOST_PATH ]]; then
|
||||||
@@ -46,7 +51,8 @@ domains_setup() {
|
|||||||
domains_add() {
|
domains_add() {
|
||||||
declare desc="add list of domains to app"
|
declare desc="add list of domains to app"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
local APP="$1"
|
||||||
|
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
for DOMAIN in "$@"; do
|
for DOMAIN in "$@"; do
|
||||||
@@ -56,7 +62,10 @@ domains_add() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
for DOMAIN in "$@"; do
|
for DOMAIN in "$@"; do
|
||||||
if [[ $(egrep -w "^$DOMAIN$" "$APP_VHOST_PATH" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
|
if [[ $(
|
||||||
|
egrep -w "^$DOMAIN$" "$APP_VHOST_PATH" >/dev/null 2>&1
|
||||||
|
echo $?
|
||||||
|
) -eq 0 ]]; then
|
||||||
dokku_log_info1 "Skipping: $DOMAIN already added to $APP"
|
dokku_log_info1 "Skipping: $DOMAIN already added to $APP"
|
||||||
else
|
else
|
||||||
echo "$DOMAIN" >>"$APP_VHOST_PATH"
|
echo "$DOMAIN" >>"$APP_VHOST_PATH"
|
||||||
@@ -74,7 +83,8 @@ domains_add() {
|
|||||||
domains_remove() {
|
domains_remove() {
|
||||||
declare desc="remove list of app domains"
|
declare desc="remove list of app domains"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
local APP="$1"
|
||||||
|
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
touch "$APP_VHOST_PATH"
|
touch "$APP_VHOST_PATH"
|
||||||
@@ -88,7 +98,8 @@ domains_remove() {
|
|||||||
domains_set() {
|
domains_set() {
|
||||||
declare desc="set list of domains for app"
|
declare desc="set list of domains for app"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
local APP="$1"
|
||||||
|
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
touch "$APP_VHOST_PATH"
|
touch "$APP_VHOST_PATH"
|
||||||
@@ -111,7 +122,8 @@ domains_set() {
|
|||||||
domains_disable() {
|
domains_disable() {
|
||||||
declare desc="disable domains/VHOST support"
|
declare desc="disable domains/VHOST support"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
local APP="$1"
|
||||||
|
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
|
|
||||||
touch "$APP_VHOST_PATH"
|
touch "$APP_VHOST_PATH"
|
||||||
if [[ "$(is_app_vhost_enabled "$APP")" == "true" ]]; then
|
if [[ "$(is_app_vhost_enabled "$APP")" == "true" ]]; then
|
||||||
@@ -124,7 +136,8 @@ domains_disable() {
|
|||||||
domains_enable() {
|
domains_enable() {
|
||||||
declare desc="enable domains/VHOST support"
|
declare desc="enable domains/VHOST support"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
local APP="$1"
|
||||||
|
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
local DEFAULT_VHOSTS="$(get_default_vhosts "$APP")"
|
local DEFAULT_VHOSTS="$(get_default_vhosts "$APP")"
|
||||||
|
|
||||||
touch "$APP_VHOST_PATH"
|
touch "$APP_VHOST_PATH"
|
||||||
@@ -151,7 +164,10 @@ domains_add_global() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
for DOMAIN in "$@"; do
|
for DOMAIN in "$@"; do
|
||||||
if [[ $(egrep -w "^$DOMAIN$" "$GLOBAL_VHOST_PATH" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
|
if [[ $(
|
||||||
|
egrep -w "^$DOMAIN$" "$GLOBAL_VHOST_PATH" >/dev/null 2>&1
|
||||||
|
echo $?
|
||||||
|
) -eq 0 ]]; then
|
||||||
dokku_log_info1 "Skipping: $DOMAIN already added"
|
dokku_log_info1 "Skipping: $DOMAIN already added"
|
||||||
else
|
else
|
||||||
sed -i -e "\$a\\$DOMAIN" "$GLOBAL_VHOST_PATH"
|
sed -i -e "\$a\\$DOMAIN" "$GLOBAL_VHOST_PATH"
|
||||||
@@ -190,7 +206,8 @@ enable_app_vhost() {
|
|||||||
declare desc="enable vhost support for given application"
|
declare desc="enable vhost support for given application"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP=$1; verify_app_name "$APP"
|
local APP=$1
|
||||||
|
verify_app_name "$APP"
|
||||||
|
|
||||||
plugn trigger pre-enable-vhost "$APP"
|
plugn trigger pre-enable-vhost "$APP"
|
||||||
[[ "$2" == "--no-restart" ]] && local CONFIG_SET_ARGS=$2
|
[[ "$2" == "--no-restart" ]] && local CONFIG_SET_ARGS=$2
|
||||||
@@ -201,7 +218,8 @@ enable_app_vhost() {
|
|||||||
get_app_domains() {
|
get_app_domains() {
|
||||||
declare desc="return app domains"
|
declare desc="return app domains"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP=$1; local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST"
|
local APP=$1
|
||||||
|
local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST"
|
||||||
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||||
local GLOBAL_HOSTNAME_PATH="$DOKKU_ROOT/HOSTNAME"
|
local GLOBAL_HOSTNAME_PATH="$DOKKU_ROOT/HOSTNAME"
|
||||||
|
|
||||||
@@ -219,8 +237,9 @@ get_app_domains() {
|
|||||||
get_default_vhosts() {
|
get_default_vhosts() {
|
||||||
declare desc="return default vhosts"
|
declare desc="return default vhosts"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local RE_IPV4="$(get_ipv4_regex)"; local RE_IPV6="$(get_ipv6_regex)"
|
local APP="$1"
|
||||||
|
local RE_IPV4="$(get_ipv4_regex)"
|
||||||
|
local RE_IPV6="$(get_ipv6_regex)"
|
||||||
|
|
||||||
if [[ "$(is_global_vhost_enabled)" == "true" ]]; then
|
if [[ "$(is_global_vhost_enabled)" == "true" ]]; then
|
||||||
local VHOSTS=$(get_global_vhosts)
|
local VHOSTS=$(get_global_vhosts)
|
||||||
@@ -253,7 +272,8 @@ is_app_vhost_enabled() {
|
|||||||
declare desc="returns true or false if vhost support is enabled for a given application"
|
declare desc="returns true or false if vhost support is enabled for a given application"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local APP=$1; verify_app_name "$APP"
|
local APP=$1
|
||||||
|
verify_app_name "$APP"
|
||||||
local NO_VHOST=$(config_get "$APP" NO_VHOST)
|
local NO_VHOST=$(config_get "$APP" NO_VHOST)
|
||||||
local APP_VHOST_ENABLED=true
|
local APP_VHOST_ENABLED=true
|
||||||
|
|
||||||
@@ -283,7 +303,8 @@ is_global_vhost_enabled() {
|
|||||||
|
|
||||||
is_valid_hostname() {
|
is_valid_hostname() {
|
||||||
declare desc="return 0 if argument is a valid hostname; else return 1"
|
declare desc="return 0 if argument is a valid hostname; else return 1"
|
||||||
local hostname_string="${1,,}"; local hostname_regex='^([a-z0-9\*-]+\.)*[a-z0-9\*-]+$'
|
local hostname_string="${1,,}"
|
||||||
|
local hostname_regex='^([a-z0-9\*-]+\.)*[a-z0-9\*-]+$'
|
||||||
if [[ $hostname_string =~ $hostname_regex ]]; then
|
if [[ $hostname_string =~ $hostname_regex ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
for app in $DOKKU_ROOT/*/CONTAINER; do
|
for app in $DOKKU_ROOT/*/CONTAINER; do
|
||||||
APP=$(basename "$(dirname "$app")");
|
APP=$(basename "$(dirname "$app")")
|
||||||
domains_setup "$APP"
|
domains_setup "$APP"
|
||||||
done
|
done
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-domains-report() {
|
cmd-domains-report() {
|
||||||
declare desc="displays a domains report for one or more apps"
|
declare desc="displays a domains report for one or more apps"
|
||||||
@@ -47,7 +48,8 @@ cmd-domains-report-single() {
|
|||||||
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
local match=false; local value_exists=false
|
local match=false
|
||||||
|
local value_exists=false
|
||||||
for flag in "${flag_map[@]}"; do
|
for flag in "${flag_map[@]}"; do
|
||||||
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
|
||||||
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
|
||||||
@@ -83,7 +85,7 @@ help_content
|
|||||||
}
|
}
|
||||||
|
|
||||||
domains_help_cmd() {
|
domains_help_cmd() {
|
||||||
if [[ $1 = "domains:help" ]] ; then
|
if [[ $1 == "domains:help" ]]; then
|
||||||
echo -e 'Usage: dokku domains[:COMMAND]'
|
echo -e 'Usage: dokku domains[:COMMAND]'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Manage vhost domains used by the Dokku proxy.'
|
echo 'Manage vhost domains used by the Dokku proxy.'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
domains_post_app_clone_setup() {
|
domains_post_app_clone_setup() {
|
||||||
declare desc="removes domain files when setting up a clone"
|
declare desc="removes domain files when setting up a clone"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-domains-report-single "$@"
|
cmd-domains-report-single "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
@@ -8,7 +9,8 @@ domains_clear_cmd() {
|
|||||||
local cmd="domains:clear"
|
local cmd="domains:clear"
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
verify_app_name "$2"
|
verify_app_name "$2"
|
||||||
local APP="$2"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
local APP="$2"
|
||||||
|
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
|
|
||||||
rm -f "$APP_VHOST_PATH"
|
rm -f "$APP_VHOST_PATH"
|
||||||
domains_setup "$APP"
|
domains_setup "$APP"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
cmd-domains-report "$@"
|
cmd-domains-report "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 275 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user