Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c94658ea09 | ||
|
|
6ed6db2b3f | ||
|
|
354309feec | ||
|
|
26a1948e50 | ||
|
|
28a8a0f84e | ||
|
|
11435f7452 | ||
|
|
f2a802819f | ||
|
|
1465f6f3ca | ||
|
|
c276507d3b | ||
|
|
98edfb9bb2 | ||
|
|
c32f4e92a1 | ||
|
|
1542a9556f | ||
|
|
4948e2b91d | ||
|
|
621e018999 | ||
|
|
3641c2dc76 | ||
|
|
86a032a32f | ||
|
|
b68ae2d0bd | ||
|
|
30b033ee9d | ||
|
|
9fac5a4ad4 | ||
|
|
73a8ccc085 | ||
|
|
e6810fa7e0 |
@@ -23,7 +23,7 @@ postgres:backup-auth <name> <aws_access_key_id> <aws_secret_access_key> (<aws_de
|
|||||||
postgres:backup-deauth <name> Removes backup authentication for the postgres service
|
postgres:backup-deauth <name> Removes backup authentication for the postgres service
|
||||||
postgres:backup-schedule <name> <schedule> <bucket> Schedules a backup of the postgres service
|
postgres:backup-schedule <name> <schedule> <bucket> Schedules a backup of the postgres service
|
||||||
postgres:backup-schedule-cat <name> Show the backup schedule for the service
|
postgres:backup-schedule-cat <name> Show the backup schedule for the service
|
||||||
postgres:backup-set-encryption <name> <encryption_key> Sets up GPG encryption for future backups of the postgres service
|
postgres:backup-set-encryption <name> <passphrase> Set a GPG passphrase for backups
|
||||||
postgres:backup-unschedule <name> Unschedules the backup of the postgres service
|
postgres:backup-unschedule <name> Unschedules the backup of the postgres service
|
||||||
postgres:backup-unset-encryption <name> Removes backup encryption for future backups of the postgres service
|
postgres:backup-unset-encryption <name> Removes backup encryption for future backups of the postgres service
|
||||||
postgres:clone <name> <new-name> Create container <new-name> then copy data from <name> into <new-name>
|
postgres:clone <name> <new-name> Create container <new-name> then copy data from <name> into <new-name>
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ service_backup() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
docker run $BACKUP_PARAMETERS dokkupaas/s3backup:0.8.0
|
docker run --rm $BACKUP_PARAMETERS dokkupaas/s3backup:0.8.0
|
||||||
}
|
}
|
||||||
|
|
||||||
service_backup_auth() {
|
service_backup_auth() {
|
||||||
@@ -283,6 +283,7 @@ service_container_rm() {
|
|||||||
[[ -z "$ID" ]] && return 0
|
[[ -z "$ID" ]] && return 0
|
||||||
|
|
||||||
dokku_log_verbose_quiet "Removing container"
|
dokku_log_verbose_quiet "Removing container"
|
||||||
|
docker update --restart=no "$SERVICE_NAME" > /dev/null 2>&1
|
||||||
if ! docker rm "$SERVICE_NAME" > /dev/null 2>&1; then
|
if ! docker rm "$SERVICE_NAME" > /dev/null 2>&1; then
|
||||||
dokku_log_fail "Unable to remove container for service $SERVICE"
|
dokku_log_fail "Unable to remove container for service $SERVICE"
|
||||||
fi
|
fi
|
||||||
@@ -440,7 +441,11 @@ service_list() {
|
|||||||
if [[ -z $SERVICES ]]; then
|
if [[ -z $SERVICES ]]; then
|
||||||
dokku_log_warn "There are no $PLUGIN_SERVICE services"
|
dokku_log_warn "There are no $PLUGIN_SERVICE services"
|
||||||
else
|
else
|
||||||
LIST="NAME,VERSION,STATUS,EXPOSED PORTS,LINKS\n"
|
LIST=""
|
||||||
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
|
LIST="NAME,VERSION,STATUS,EXPOSED PORTS,LINKS\n"
|
||||||
|
fi
|
||||||
|
|
||||||
for SERVICE in $SERVICES; do
|
for SERVICE in $SERVICES; do
|
||||||
LIST+="$SERVICE,$(service_version "$SERVICE"),$(service_status "$SERVICE"),$(service_exposed_ports "$SERVICE"),$(service_linked_apps "$SERVICE")\n"
|
LIST+="$SERVICE,$(service_version "$SERVICE"),$(service_status "$SERVICE"),$(service_exposed_ports "$SERVICE"),$(service_linked_apps "$SERVICE")\n"
|
||||||
done
|
done
|
||||||
@@ -662,7 +667,7 @@ service_stop() {
|
|||||||
declare SERVICE="$1"
|
declare SERVICE="$1"
|
||||||
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE";
|
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE";
|
||||||
local SERVICE_NAME="$(get_service_name "$SERVICE")"
|
local SERVICE_NAME="$(get_service_name "$SERVICE")"
|
||||||
local ID=$(docker ps -f status=running | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
local ID=$(docker ps -f status=running --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
||||||
[[ -z $ID ]] && dokku_log_warn "Service is already stopped" && return 0
|
[[ -z $ID ]] && dokku_log_warn "Service is already stopped" && return 0
|
||||||
|
|
||||||
if [[ -n $ID ]]; then
|
if [[ -n $ID ]]; then
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ service_create_container() {
|
|||||||
service_stop "$SERVICE" > /dev/null
|
service_stop "$SERVICE" > /dev/null
|
||||||
docker run --rm -i -v "$SERVICE_HOST_ROOT/data:/var/lib/postgresql/data" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" bash -s < "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/enable_ssl.sh" &> /dev/null
|
docker run --rm -i -v "$SERVICE_HOST_ROOT/data:/var/lib/postgresql/data" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" bash -s < "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/enable_ssl.sh" &> /dev/null
|
||||||
|
|
||||||
PREVIOUS_ID=$(docker ps -f status=exited | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
PREVIOUS_ID=$(docker ps -f status=exited --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
||||||
docker start "$PREVIOUS_ID" > /dev/null
|
docker start "$PREVIOUS_ID" > /dev/null
|
||||||
service_port_unpause "$SERVICE"
|
service_port_unpause "$SERVICE"
|
||||||
|
|
||||||
@@ -122,14 +122,14 @@ service_start() {
|
|||||||
local QUIET="$2"
|
local QUIET="$2"
|
||||||
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
||||||
local SERVICE_NAME="$(get_service_name "$SERVICE")"
|
local SERVICE_NAME="$(get_service_name "$SERVICE")"
|
||||||
local ID=$(docker ps -f status=running | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
local ID=$(docker ps -f status=running --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
||||||
if [[ -n $ID ]]; then
|
if [[ -n $ID ]]; then
|
||||||
[[ -z $QUIET ]] && dokku_log_warn "Service is already started"
|
[[ -z $QUIET ]] && dokku_log_warn "Service is already started"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dokku_log_info2_quiet "Starting container"
|
dokku_log_info2_quiet "Starting container"
|
||||||
local PREVIOUS_ID=$(docker ps -f status=exited | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
local PREVIOUS_ID=$(docker ps -f status=exited --no-trunc | grep -e "$SERVICE_NAME$" | awk '{print $1}') || true
|
||||||
local PASSWORD="$(cat "$SERVICE_ROOT/PASSWORD")"
|
local PASSWORD="$(cat "$SERVICE_ROOT/PASSWORD")"
|
||||||
|
|
||||||
if [[ -n $PREVIOUS_ID ]]; then
|
if [[ -n $PREVIOUS_ID ]]; then
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ fn-help() {
|
|||||||
|
|
||||||
fn-help-all() {
|
fn-help-all() {
|
||||||
declare CMD="$1" SUBCOMMAND="$2"
|
declare CMD="$1" SUBCOMMAND="$2"
|
||||||
local CMD_OUTPUT BLUE BOLD FULL_OUTPUT NORMAL
|
local CMD_OUTPUT BLUE BOLD FULL_OUTPUT NORMAL
|
||||||
FULL_OUTPUT=true
|
FULL_OUTPUT=true
|
||||||
|
|
||||||
if [[ "$CMD" = "$PLUGIN_COMMAND_PREFIX:help" ]] || [[ "$CMD" == "$PLUGIN_COMMAND_PREFIX" ]] || [[ "$CMD" == "$PLUGIN_COMMAND_PREFIX:default" ]] ; then
|
if [[ "$CMD" = "$PLUGIN_COMMAND_PREFIX:help" ]] || [[ "$CMD" == "$PLUGIN_COMMAND_PREFIX" ]] || [[ "$CMD" == "$PLUGIN_COMMAND_PREFIX:default" ]] ; then
|
||||||
BOLD="$(tput bold)"
|
BOLD="$(fn-help-fancy-tput bold)"
|
||||||
NORMAL="\033[m"
|
NORMAL="$(fn-help-fancy-color "\033[m")"
|
||||||
BLUE="\033[0;34m"
|
BLUE="$(fn-help-fancy-color "\033[0;34m")"
|
||||||
CYAN="\033[1;36m"
|
CYAN="$(fn-help-fancy-color "\033[1;36m")"
|
||||||
if [[ -n "$SUBCOMMAND" ]] && [[ "$SUBCOMMAND" != "--all" ]]; then
|
if [[ -n "$SUBCOMMAND" ]] && [[ "$SUBCOMMAND" != "--all" ]]; then
|
||||||
fn-help-contents-subcommand "$SUBCOMMAND" "$FULL_OUTPUT"
|
fn-help-contents-subcommand "$SUBCOMMAND" "$FULL_OUTPUT"
|
||||||
return "$?"
|
return "$?"
|
||||||
@@ -95,12 +95,12 @@ fn-help-contents-subcommand() {
|
|||||||
desc="$(grep desc "$CLEAN_FILE" | head -1)"
|
desc="$(grep desc "$CLEAN_FILE" | head -1)"
|
||||||
eval "$desc"
|
eval "$desc"
|
||||||
|
|
||||||
BLUE="\033[0;34m"
|
BLUE="$(fn-help-fancy-color "\033[0;34m")"
|
||||||
BOLD="$(tput bold)"
|
BOLD="$(fn-help-fancy-tput bold)"
|
||||||
CYAN="\033[1;36m"
|
CYAN="$(fn-help-fancy-color "\033[1;36m")"
|
||||||
NORMAL="\033[m"
|
NORMAL="$(fn-help-fancy-color "\033[m")"
|
||||||
LIGHT_GRAY="\033[2;37m"
|
LIGHT_GRAY="$(fn-help-fancy-color "\033[2;37m")"
|
||||||
LIGHT_RED="\033[1;31m"
|
LIGHT_RED="$(fn-help-fancy-color "\033[1;31m")"
|
||||||
CMD_OUTPUT="$(echo -e " ${PLUGIN_COMMAND_PREFIX}${cmd_line}, ${LIGHT_GRAY}${desc}${NORMAL}")"
|
CMD_OUTPUT="$(echo -e " ${PLUGIN_COMMAND_PREFIX}${cmd_line}, ${LIGHT_GRAY}${desc}${NORMAL}")"
|
||||||
if [[ "$FULL_OUTPUT" != "true" ]]; then
|
if [[ "$FULL_OUTPUT" != "true" ]]; then
|
||||||
echo "$CMD_OUTPUT"
|
echo "$CMD_OUTPUT"
|
||||||
@@ -139,6 +139,26 @@ fn-help-contents-subcommand() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn-help-fancy-tput() {
|
||||||
|
declare desc="A wrapper around tput"
|
||||||
|
|
||||||
|
if [[ -n "$DOKKU_NO_COLOR" ]] || [[ "$TERM" = "unknown" ]] || [[ "$TERM" == "dumb" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
tput "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-help-fancy-color() {
|
||||||
|
declare desc="A wrapper around colors"
|
||||||
|
|
||||||
|
if [[ -n "$DOKKU_NO_COLOR" ]] || [[ "$TERM" = "unknown" ]] || [[ "$TERM" == "dumb" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$@"
|
||||||
|
}
|
||||||
|
|
||||||
fn-help-list-example() {
|
fn-help-list-example() {
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
declare desc="return $PLUGIN_COMMAND_PREFIX plugin help content"
|
declare desc="return $PLUGIN_COMMAND_PREFIX plugin help content"
|
||||||
@@ -153,8 +173,8 @@ fn-help-subcommand-args() {
|
|||||||
local argline arglist args argpos BLUE NORMAL
|
local argline arglist args argpos BLUE NORMAL
|
||||||
|
|
||||||
if [[ "$FULL_OUTPUT" == "true" ]]; then
|
if [[ "$FULL_OUTPUT" == "true" ]]; then
|
||||||
BLUE="\033[0;34m"
|
BLUE="$(fn-help-fancy-color "\033[0;34m")"
|
||||||
NORMAL="\033[m"
|
NORMAL="$(fn-help-fancy-color "\033[m")"
|
||||||
fi
|
fi
|
||||||
argline=$(grep declare "$FUNC_FILE" | grep -v "declare desc" | head -1 || true)
|
argline=$(grep declare "$FUNC_FILE" | grep -v "declare desc" | head -1 || true)
|
||||||
arglist=($(echo -e "${argline// /"\n"}" | awk -F= '/=/{print ""$1""}'))
|
arglist=($(echo -e "${argline// /"\n"}" | awk -F= '/=/{print ""$1""}'))
|
||||||
@@ -199,12 +219,12 @@ fn-help-subcommand-example() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BOLD="$(tput bold)"
|
BOLD="$(fn-help-fancy-tput bold)"
|
||||||
LAST_LINE=""
|
LAST_LINE=""
|
||||||
LIGHT_GRAY="\033[2;37m"
|
LIGHT_GRAY="$(fn-help-fancy-color "\033[2;37m")"
|
||||||
OTHER_GRAY="\033[7;37m"
|
OTHER_GRAY="$(fn-help-fancy-color "\033[7;37m")"
|
||||||
NEWLINE=""
|
NEWLINE=""
|
||||||
NORMAL="\033[m"
|
NORMAL="$(fn-help-fancy-color "\033[m")"
|
||||||
_fn-help-apply-shell-expansion "$EXAMPLE" | while read -r line; do
|
_fn-help-apply-shell-expansion "$EXAMPLE" | while read -r line; do
|
||||||
line="$(echo "$line" | cut -c 4-)"
|
line="$(echo "$line" | cut -c 4-)"
|
||||||
if [[ "$line" == export* ]] || [[ "$line" == dokku* ]]; then
|
if [[ "$line" == export* ]] || [[ "$line" == dokku* ]]; then
|
||||||
@@ -234,10 +254,10 @@ fn-help-subcommand-list-args() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NORMAL="\033[m"
|
NORMAL="$(fn-help-fancy-color "\033[m")"
|
||||||
LIGHT_GRAY="\033[2;37m"
|
LIGHT_GRAY="$(fn-help-fancy-color "\033[2;37m")"
|
||||||
|
|
||||||
_fn-help-apply-shell-expansion "$FLAGS" | while read -r line; do
|
_fn-help-apply-shell-expansion "$FLAGS" | while read -r line; do
|
||||||
echo -e "$(echo "$line" | cut -d',' -f1),${LIGHT_GRAY}$(echo "$line" | cut -d',' -f2-)${NORMAL}"
|
echo -e "$(echo "$line" | cut -d',' -f1),${LIGHT_GRAY}$(echo "$line" | cut -d',' -f2-)${NORMAL}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -251,10 +271,10 @@ fn-help-subcommand-list-flags() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NORMAL="\033[m"
|
NORMAL="$(fn-help-fancy-color "\033[m")"
|
||||||
LIGHT_GRAY="\033[2;37m"
|
LIGHT_GRAY="$(fn-help-fancy-color "\033[2;37m")"
|
||||||
|
|
||||||
_fn-help-apply-shell-expansion "$FLAGS" | while read -r line; do
|
_fn-help-apply-shell-expansion "$FLAGS" | while read -r line; do
|
||||||
echo -e "$(echo "$line" | cut -d',' -f1),${LIGHT_GRAY}$(echo "$line" | cut -d',' -f2-)${NORMAL}"
|
echo -e "$(echo "$line" | cut -d',' -f1),${LIGHT_GRAY}$(echo "$line" | cut -d',' -f2-)${NORMAL}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku postgres service plugin"
|
description = "dokku postgres service plugin"
|
||||||
version = "1.4.6"
|
version = "1.4.12"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -5,19 +5,19 @@ source "$PLUGIN_BASE_PATH/common/functions"
|
|||||||
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
|
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
|
||||||
|
|
||||||
service-backup-set-encryption-cmd() {
|
service-backup-set-encryption-cmd() {
|
||||||
#E set a GPG encryption key for backups
|
#E set a GPG passphrase for backups
|
||||||
#E dokku $PLUGIN_COMMAND_PREFIX:backup-set-encryption lolipop
|
#E dokku $PLUGIN_COMMAND_PREFIX:backup-set-encryption lolipop
|
||||||
#A service, service to run command against
|
#A service, service to run command against
|
||||||
#A encryption-key, a GPG encryption key
|
#A passphrase, a GPG-compatible passphrase
|
||||||
declare desc="sets encryption for all future backups of $PLUGIN_SERVICE service"
|
declare desc="sets encryption for all future backups of $PLUGIN_SERVICE service"
|
||||||
local cmd="$PLUGIN_COMMAND_PREFIX:backup-set-encryption" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
local cmd="$PLUGIN_COMMAND_PREFIX:backup-set-encryption" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
declare SERVICE="$1" ENCRYPTION_KEY="$2"
|
declare SERVICE="$1" PASSPHRASE="$2"
|
||||||
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented"
|
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented"
|
||||||
|
|
||||||
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a name for the service"
|
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a name for the service"
|
||||||
[[ -z "$ENCRYPTION_KEY" ]] && dokku_log_fail "Please specify a GPG encryption key"
|
[[ -z "$PASSPHRASE" ]] && dokku_log_fail "Please specify a GPG backup passphrase"
|
||||||
verify_service_name "$SERVICE"
|
verify_service_name "$SERVICE"
|
||||||
service_backup_set_encryption "$SERVICE" "$ENCRYPTION_KEY"
|
service_backup_set_encryption "$SERVICE" "$PASSPHRASE"
|
||||||
}
|
}
|
||||||
|
|
||||||
service-backup-set-encryption-cmd "$@"
|
service-backup-set-encryption-cmd "$@"
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ service-destroy-cmd() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
dokku_log_info2_quiet "Deleting $SERVICE"
|
dokku_log_info2_quiet "Deleting $SERVICE"
|
||||||
|
service_backup_unschedule "$SERVICE"
|
||||||
if [[ -n $(docker ps -aq -f name="$SERVICE_NAME") ]]; then
|
if [[ -n $(docker ps -aq -f name="$SERVICE_NAME") ]]; then
|
||||||
dokku_log_verbose_quiet "Deleting container data"
|
dokku_log_verbose_quiet "Deleting container data"
|
||||||
service_stop "$SERVICE"
|
service_stop "$SERVICE"
|
||||||
|
|||||||
@@ -15,14 +15,12 @@ service-upgrade-cmd() {
|
|||||||
#F -R|--restart-apps "true", whether to force an app restart
|
#F -R|--restart-apps "true", whether to force an app restart
|
||||||
declare desc="upgrade service <service> to the specified versions"
|
declare desc="upgrade service <service> to the specified versions"
|
||||||
local cmd="$PLUGIN_COMMAND_PREFIX:upgrade" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
local cmd="$PLUGIN_COMMAND_PREFIX:upgrade" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
declare SERVICE="$1" UPGRADE_FLAG_LIST="${@:2}"
|
declare SERVICE="$1" UPGRADE_FLAGS_LIST="${@:2}"
|
||||||
|
|
||||||
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a name for the service"
|
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a name for the service"
|
||||||
verify_service_name "$SERVICE"
|
verify_service_name "$SERVICE"
|
||||||
|
|
||||||
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
||||||
local ID="$(cat "$SERVICE_ROOT/ID")"
|
|
||||||
is_container_status "$ID" "Running" || dokku_log_fail "Service ${SERVICE} container is not running"
|
|
||||||
|
|
||||||
service_parse_args "${@:2}"
|
service_parse_args "${@:2}"
|
||||||
|
|
||||||
@@ -30,10 +28,17 @@ service-upgrade-cmd() {
|
|||||||
dokku_log_fail "Unable to proceed with upgrade, image ${PLUGIN_IMAGE}:${PLUGIN_IMAGE_VERSION} does not exist"
|
dokku_log_fail "Unable to proceed with upgrade, image ${PLUGIN_IMAGE}:${PLUGIN_IMAGE_VERSION} does not exist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dokku_log_info2 "Upgrading $SERVICE to $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
|
local NEW_PLUGIN_IMAGE_TAG="$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
|
||||||
|
if [[ "$(service_version "$SERVICE")" == "$NEW_PLUGIN_IMAGE_TAG" ]]; then
|
||||||
|
dokku_log_info1 "Service $SERVICE already running $NEW_PLUGIN_IMAGE_TAG"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
dokku_log_info2 "Upgrading $SERVICE to $NEW_PLUGIN_IMAGE_TAG"
|
||||||
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
|
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
|
||||||
dokku_log_info2 "Stopping all linked services"
|
dokku_log_info2 "Stopping all linked services"
|
||||||
for app in $(service_linked_apps "$SERVICE"); do
|
for app in $(service_linked_apps "$SERVICE"); do
|
||||||
|
[[ "$app" == "-" ]] && continue
|
||||||
ps_stop "$app"
|
ps_stop "$app"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -45,6 +50,7 @@ service-upgrade-cmd() {
|
|||||||
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
|
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
|
||||||
dokku_log_info2 "Starting all linked services"
|
dokku_log_info2 "Starting all linked services"
|
||||||
for app in $(service_linked_apps "$SERVICE"); do
|
for app in $(service_linked_apps "$SERVICE"); do
|
||||||
|
[[ "$app" == "-" ]] && continue
|
||||||
ps_start "$app"
|
ps_start "$app"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
1
tests/test_helper.bash
Normal file → Executable file
1
tests/test_helper.bash
Normal file → Executable file
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
export DOKKU_QUIET_OUTPUT=1
|
|
||||||
export DOKKU_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/dokku"
|
export DOKKU_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/dokku"
|
||||||
export DOKKU_VERSION=${DOKKU_VERSION:-"master"}
|
export DOKKU_VERSION=${DOKKU_VERSION:-"master"}
|
||||||
export PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/bin:$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/dokku:$PATH"
|
export PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/bin:$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/dokku:$PATH"
|
||||||
|
|||||||
Reference in New Issue
Block a user