Compare commits

..

7 Commits
1.4.0 ... 1.4.3

Author SHA1 Message Date
Jose Diaz-Gonzalez
bbe8fee561 Release 1.4.3 2018-10-10 23:18:32 -04:00
Jose Diaz-Gonzalez
5f2e184d68 feat: add support for restarting containers to ensure links continue to work properly when the application has resolved dns of the link 2018-10-10 23:14:45 -04:00
Jose Diaz-Gonzalez
8a8857374c fix: handle case where container being removed does not exist 2018-10-10 22:03:44 -04:00
Jose Diaz-Gonzalez
2176ab836e Release 1.4.2 2018-10-10 03:03:32 -04:00
Jose Diaz-Gonzalez
1c35653e7e fix: correct short-flag for image-version and custom-env 2018-10-10 03:02:56 -04:00
Jose Diaz-Gonzalez
7c17773fb2 Release 1.4.1 2018-10-10 03:01:09 -04:00
Jose Diaz-Gonzalez
980e7d1650 fix: correct name for upgrade flags in help output 2018-10-10 03:00:22 -04:00
5 changed files with 45 additions and 23 deletions

View File

@@ -279,9 +279,12 @@ service_container_rm() {
local SERVICE_NAME="$(get_service_name "$SERVICE")"
service_stop "$SERVICE"
local ID=$(docker inspect "$SERVICE_NAME" -f '{{ .ID }}' 2> /dev/null || true)
[[ -z "$ID" ]] && return 0
dokku_log_verbose_quiet "Removing container"
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
}
@@ -471,24 +474,24 @@ service_parse_args() {
for arg in "$@"; do
shift
case "$arg" in
"--config-options") set -- "$@" "-c" ;;
"--custom-env") set -- "$@" "-C" ;;
"--image") set -- "$@" "-i" ;;
"--image-version") set -- "$@" "-I" ;;
"--password") set -- "$@" "-p" ;;
"--root-password") set -- "$@" "-r" ;;
"--alias") set -- "$@" "-a" ;;
"--database") set -- "$@" "-d" ;;
"--memory") set -- "$@" "-m" ;;
"--querystring") set -- "$@" "-q" ;;
"--user") set -- "$@" "-u" ;;
*) set -- "$@" "$arg"
"--alias") set -- "$@" "-a" ;;
"--config-options") set -- "$@" "-c" ;;
"--custom-env") set -- "$@" "-C" ;;
"--database") set -- "$@" "-d" ;;
"--image-version") set -- "$@" "-I" ;;
"--image") set -- "$@" "-i" ;;
"--memory") set -- "$@" "-m" ;;
"--password") set -- "$@" "-p" ;;
"--querystring") set -- "$@" "-q" ;;
"--restart-apps") set -- "$@" "-R" ;;
"--root-password") set -- "$@" "-r" ;;
"--user") set -- "$@" "-u" ;;
*) set -- "$@" "$arg"
esac
done
OPTIND=1
while getopts "a:c:C:d:i:I:m:p:q:r:u:" opt; do
while getopts "a:c:C:d:i:I:m:p:q:R:r:u:" opt; do
case "$opt" in
a)
SERVICE_ALIAS="${OPTARG^^}"; export SERVICE_ALIAS="${SERVICE_ALIAS%_URL}"
@@ -509,6 +512,8 @@ service_parse_args() {
;;
q) export SERVICE_QUERYSTRING=${OPTARG#"?"}
;;
R) export SERVICE_RESTART_APPS=$OPTARG
;;
r) export SERVICE_ROOT_PASSWORD=$OPTARG
;;
u) export SERVICE_USER=$OPTARG

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku mysql service plugin"
version = "1.4.0"
version = "1.4.3"
[plugin.config]

View File

@@ -9,9 +9,9 @@ service-clone-cmd() {
#E dokku $PLUGIN_COMMAND_PREFIX:clone lolipop lolipop-2
#A service, service to run command against
#A new-service, name of new service
#F -c|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -i|--image IMAGE, the image name to start the service with
#F -i|--image-version IMAGE_VERSION, the image version to start the service with
#F -I|--image-version IMAGE_VERSION, the image version to start the service with
#F -p|--password PASSWORD, override the user-level service password
#F -r|--root-password PASSWORD, override the root-level service password
declare desc="create container <new-name> then copy data from <name> into <new-name>"

View File

@@ -17,9 +17,9 @@ service-create-cmd() {
#E export ${PLUGIN_DEFAULT_ALIAS}_CUSTOM_ENV="USER=alpha;HOST=beta"
#E dokku $PLUGIN_COMMAND_PREFIX:create lolipop
#A service, service to run command against
#F -c|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -i|--image IMAGE, the image name to start the service with
#F -i|--image-version IMAGE_VERSION, the image version to start the service with
#F -I|--image-version IMAGE_VERSION, the image version to start the service with
#F -p|--password PASSWORD, override the user-level service password
#F -r|--root-password PASSWORD, override the root-level service password
declare desc="create a $PLUGIN_SERVICE service"

View File

@@ -3,17 +3,19 @@ source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_BASE_PATH/common/functions"
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
service-upgrade-cmd() {
#E you can upgrade an existing service to a new image or image-version
#E dokku $PLUGIN_COMMAND_PREFIX:upgrade lolipop
#A service, service to run command against
#F -c|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -i|--image IMAGE, the image name to start the service with
#F -i|--image-version IMAGE_VERSION, the image version to start the service with
#F -I|--image-version IMAGE_VERSION, the image version to start the service with
#F -R|--restart-apps "true", whether to force an app restart
declare desc="upgrade service <service> to the specified versions"
local cmd="$PLUGIN_COMMAND_PREFIX:upgrade" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1" CLONE_FLAGS_LIST="${@:2}"
declare SERVICE="$1" UPGRADE_FLAG_LIST="${@:2}"
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a name for the service"
verify_service_name "$SERVICE"
@@ -29,9 +31,24 @@ service-upgrade-cmd() {
fi
dokku_log_info2 "Upgrading $SERVICE to $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
dokku_log_info2 "Stopping all linked services"
for app in $(service_linked_apps "$SERVICE"); do
ps_stop "$app"
done
fi
dokku_log_info2 "Stopping $SERVICE"
service_container_rm "$SERVICE"
service_start "$SERVICE" "${@:2}"
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
dokku_log_info2 "Starting all linked services"
for app in $(service_linked_apps "$SERVICE"); do
ps_start "$app"
done
fi
dokku_log_info2 "Done"
}