Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3ba0d51f6 | ||
|
|
39a7864022 | ||
|
|
8061f0c50a | ||
|
|
aa1a23d5a1 | ||
|
|
5e5ad6d472 | ||
|
|
733e14ee73 |
@@ -23,7 +23,7 @@ mysql:backup-auth <name> <aws_access_key_id> <aws_secret_access_key> (<aws_defau
|
|||||||
mysql:backup-deauth <name> Removes backup authentication for the mysql service
|
mysql:backup-deauth <name> Removes backup authentication for the mysql service
|
||||||
mysql:backup-schedule <name> <schedule> <bucket> Schedules a backup of the mysql service
|
mysql:backup-schedule <name> <schedule> <bucket> Schedules a backup of the mysql service
|
||||||
mysql:backup-schedule-cat <name> Cat the contents of the configured backup cronfile for the service
|
mysql:backup-schedule-cat <name> Cat the contents of the configured backup cronfile for the service
|
||||||
mysql:backup-set-encryption <name> <encryption_key> Sets up GPG encryption for future backups of the mysql service
|
mysql:backup-set-encryption <name> <passphrase> Set a GPG passphrase for backups
|
||||||
mysql:backup-unschedule <name> Unschedules the backup of the mysql service
|
mysql:backup-unschedule <name> Unschedules the backup of the mysql service
|
||||||
mysql:backup-unset-encryption <name> Removes backup encryption for future backups of the mysql service
|
mysql:backup-unset-encryption <name> Removes backup encryption for future backups of the mysql service
|
||||||
mysql:clone <name> <new-name> Create container <new-name> then copy data from <name> into <new-name>
|
mysql: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() {
|
||||||
@@ -667,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
|
||||||
|
|||||||
@@ -119,14 +119,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 ROOTPASSWORD="$(cat "$SERVICE_ROOT/ROOTPASSWORD")"
|
local ROOTPASSWORD="$(cat "$SERVICE_ROOT/ROOTPASSWORD")"
|
||||||
local PASSWORD="$(cat "$SERVICE_ROOT/PASSWORD")"
|
local PASSWORD="$(cat "$SERVICE_ROOT/PASSWORD")"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku mysql service plugin"
|
description = "dokku mysql service plugin"
|
||||||
version = "1.4.9"
|
version = "1.4.10"
|
||||||
[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"
|
||||||
|
|||||||
Reference in New Issue
Block a user