Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit f679cf7

Browse files
committed
Still merges with upstream
- Added support for DOKKU_NOT_IMPLEMENTED_EXIT - Moved dokku-ps to dokku-apps - Added some aliases - Nginx configuration is extended to support tls and ssl folder
1 parent cb0f9c2 commit f679cf7

18 files changed

Lines changed: 151 additions & 144 deletions

File tree

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# History of Dokku-alt
22

3+
## BETA
4+
5+
* Merged dokku upstream: 7c2f21fd2a854e48cab2bae82477d04ebcbdd4ae
6+
37
## 0.3.8
48

59
* Added `dokku rebuild:force myapp`, `dokku rebuild:all` and `dokku rebuild:all:force`

plugins/00_dokku-standard/commands

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,6 @@
33
source "$(dirname $0)/../dokku_common"
44

55
case "$1" in
6-
delete)
7-
verify_app_name "$2"
8-
9-
if [[ ! -d "$APP_DIR" ]]; then
10-
echo "App does not exist"
11-
exit 1
12-
fi
13-
14-
info "Deleting application $APP..."
15-
pluginhook pre-delete $APP
16-
17-
stop_and_remove_app_containers
18-
stop_and_remove_container $APP_PERSISTENT_NAMES
19-
remove_image "$IMAGE"
20-
21-
pluginhook post-delete $APP
22-
info "Application deleted: $APP"
23-
;;
24-
256
logs)
267
verify_app_name "$2"
278

plugins/01_dokku-preboot/commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ case "$1" in
4848
preboot:cooldown:time <app> <secs> Re-enable specific app
4949
EOF
5050
;;
51+
52+
*)
53+
exit $DOKKU_NOT_IMPLEMENTED_EXIT
54+
;;
5155
esac

plugins/acl/commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,8 @@ case "$1" in
9595
deploy:revoke <app> <fingerprint> Revoke push-access for an application
9696
EOF
9797
;;
98+
99+
*)
100+
exit $DOKKU_NOT_IMPLEMENTED_EXIT
101+
;;
98102
esac

plugins/apps/commands

Lines changed: 95 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,123 @@
11
#!/usr/bin/env bash
2-
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
2+
3+
source "$(dirname $0)/../dokku_common"
34

45
case "$1" in
56
apps)
67
echo "=== My Apps"
78
find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort
89
;;
910

10-
apps:create)
11-
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
12-
[[ -d "$DOKKU_ROOT/$APP" ]] && echo " ! Name is already taken" && exit 1
13-
APP="$2"
14-
15-
mkdir -p "$DOKKU_ROOT/$APP"
16-
echo "Creating $APP... done"
11+
apps:list|list)
12+
verify_max_args 1 "$@"
13+
for app in $(ls -d $DOKKU_ROOT/*/ 2>/dev/null); do
14+
if [[ -f "$app/refs/heads/master" ]]; then
15+
basename "$app"
16+
fi
17+
done
1718
;;
1819

19-
apps:destroy)
20-
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
21-
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
22-
[[ "$2" == "tls" ]] && echo "Unable to destroy tls directory" && exit 1
23-
APP="$2"; IMAGE="dokku/$APP";
24-
25-
echo " ! WARNING: Potentially Destructive Action"
26-
echo " ! This command will destroy $APP (including all add-ons)."
27-
echo " ! To proceed, type \"$APP\""
28-
echo ""
29-
30-
read -p "> " app_name
31-
if [[ "$app_name" != "$APP" ]]; then
32-
echo " ! Confirmation did not match $APP. Aborted."
33-
exit 1
20+
apps:status|status)
21+
verify_app_name "$2"
22+
verify_max_args 2 "$@"
23+
24+
if docker port "$APP_NAME" "$APP_PORT" 1>/dev/null 2>/dev/null
25+
then
26+
echo "$APP is running."
27+
else
28+
echo "$APP is stopped."
29+
fi
30+
;;
31+
32+
apps:start|start)
33+
verify_app_name "$2"
34+
verify_max_args 2 "$@"
35+
36+
docker start "$APP_NAME"
37+
;;
38+
39+
apps:stop|stop)
40+
verify_app_name "$2"
41+
verify_max_args 2 "$@"
42+
43+
docker stop "$APP_NAME"
44+
;;
45+
46+
apps:disable|disable)
47+
verify_app_name "$2"
48+
verify_max_args 2 "$@"
49+
if [[ ! -f "$APP_DIR/DISABLED" ]]; then
50+
touch "$APP_DIR/DISABLED"
51+
deploy_app "$APP"
52+
else
53+
echo "$APP: Application is already disabled"
3454
fi
55+
;;
3556

36-
echo "Destroying $APP (including all add-ons)"
57+
apps:enable|enable)
58+
verify_app_name "$2"
59+
verify_max_args 2 "$@"
60+
if [[ -f "$APP_DIR/DISABLED" ]]; then
61+
rm -f "$APP_DIR/DISABLED"
62+
deploy_app "$APP"
63+
else
64+
echo "$APP: Application is already enabled"
65+
fi
66+
;;
3767

38-
pluginhook pre-delete $APP
39-
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
40-
ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
68+
apps:restart|restart)
69+
verify_app_name "$2"
70+
verify_max_args 2 "$@"
71+
docker restart "$APP_NAME"
72+
;;
4173

42-
docker stop $ID > /dev/null || true
43-
docker rm $ID > /dev/null || true
74+
apps:top|top)
75+
verify_app_name "$2"
76+
verify_max_args 2 "$@"
77+
78+
shift 2
79+
docker top "$APP_NAME"
80+
;;
81+
82+
apps:destroy|delete)
83+
verify_app_name "$2"
84+
85+
if [[ ! -d "$APP_DIR" ]]; then
86+
echo "App does not exist"
87+
exit 1
4488
fi
4589

46-
docker images | grep $IMAGE | awk '{print $3}' | xargs docker rmi &> /dev/null &
90+
[[ "$APP" == "tls" ]] && fail "Unable to destroy tls directory"
91+
[[ "$APP" == "ssl" ]] && fail "Unable to destroy tls directory"
92+
93+
info "Deleting application $APP..."
94+
pluginhook pre-delete $APP
95+
96+
stop_and_remove_app_containers
97+
stop_and_remove_container $APP_PERSISTENT_NAMES
98+
remove_image "$IMAGE"
4799

48100
pluginhook post-delete $APP
101+
info "Application deleted: $APP"
49102
;;
50103

51-
help | apps:help)
104+
apps:create)
105+
106+
107+
help)
52108
cat && cat<<EOF
53-
apps List your apps
54-
apps:create <app> Create a new app
55-
apps:destroy <app> Permanently destroy an app
109+
list List app
110+
status <app> Status of specific app
111+
start <app> Stop specific app
112+
stop <app> Stop specific app
113+
restart <app> Restart specific app (not-redeploy)
114+
enable <app> Re-enable specific app
115+
disable <app> Disable specific app
116+
top <app> [args...] Show running processes
56117
EOF
57118
;;
58119

59120
*)
60121
exit $DOKKU_NOT_IMPLEMENTED_EXIT
61122
;;
62-
63123
esac

plugins/config/commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,8 @@ EOF
187187
exit $DOKKU_NOT_IMPLEMENTED_EXIT
188188
;;
189189

190+
*)
191+
exit $DOKKU_NOT_IMPLEMENTED_EXIT
192+
;;
193+
190194
esac

plugins/data-volumes/commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,8 @@ case "$1" in
114114
EOF
115115
;;
116116

117+
*)
118+
exit $DOKKU_NOT_IMPLEMENTED_EXIT
119+
;;
120+
117121
esac

plugins/dokku-alt-manager/commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,8 @@ case "$1" in
116116
manager:disable Disable dokku-alt-manager application
117117
EOF
118118
;;
119+
120+
*)
121+
exit $DOKKU_NOT_IMPLEMENTED_EXIT
122+
;;
119123
esac

plugins/dokku-mariadb/commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,8 @@ EOF
192192
EOF
193193
;;
194194

195+
*)
196+
exit $DOKKU_NOT_IMPLEMENTED_EXIT
197+
;;
198+
195199
esac

plugins/dokku-mongodb/commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,8 @@ EOF
199199
EOF
200200
;;
201201

202+
*)
203+
exit $DOKKU_NOT_IMPLEMENTED_EXIT
204+
;;
205+
202206
esac

0 commit comments

Comments
 (0)