File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed
Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /config"
3+ source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /common-functions"
4+ source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /functions"
5+ set -eo pipefail
6+ [[ $DOKKU_TRACE ]] && set -x
7+
8+ plugin-pre-restore () {
9+ declare SCHEDULER=" $1 " APP=" $2 "
10+
11+ if [[ " $SCHEDULER " != " docker-local" ]]; then
12+ return
13+ fi
14+
15+ local SERVICES=$( ls " $PLUGIN_DATA_ROOT " 2> /dev/null)
16+ for SERVICE in $SERVICES ; do
17+ if ! in_links_file " $SERVICE " " $APP " ; then
18+ continue
19+ fi
20+
21+ local status=" $( service_status " $SERVICE " ) "
22+ if [[ " $status " == " running" ]]; then
23+ continue
24+ fi
25+
26+ if [[ " $status " == " restarting" ]]; then
27+ dokku_log_warn " $PLUGIN_SERVICE service $SERVICE is restarting and may cause issues with linked app $APP "
28+ continue
29+ fi
30+
31+ dokku_log_warn " $PLUGIN_SERVICE service $SERVICE is not running, issuing service start"
32+ service_start " $SERVICE "
33+ done
34+ }
35+
36+ plugin-pre-restore " $@ "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /config"
3+ source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /common-functions"
4+ source " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /functions"
5+ set -eo pipefail
6+ [[ $DOKKU_TRACE ]] && set -x
7+
8+ plugin-pre-start () {
9+ declare APP=" $1 "
10+
11+ local SERVICES=$( ls " $PLUGIN_DATA_ROOT " 2> /dev/null)
12+ for SERVICE in $SERVICES ; do
13+ if ! in_links_file " $SERVICE " " $APP " ; then
14+ continue
15+ fi
16+
17+ local status=" $( service_status " $SERVICE " ) "
18+ if [[ " $status " == " running" ]]; then
19+ continue
20+ fi
21+
22+ if [[ " $status " == " restarting" ]]; then
23+ dokku_log_warn " $PLUGIN_SERVICE service $SERVICE is restarting and may cause issues with linked app $APP "
24+ continue
25+ fi
26+
27+ dokku_log_warn " $PLUGIN_SERVICE service $SERVICE is not running, issuing service start"
28+ service_start " $SERVICE "
29+ done
30+ }
31+
32+ plugin-pre-start " $@ "
You can’t perform that action at this time.
0 commit comments