Use DOKKU_ROOT_ON_HOST for Docker bind mounts

This commit is contained in:
Jody McIntyre
2018-04-09 17:51:14 -04:00
parent 13bd5864b3
commit aa5561b781
6 changed files with 12 additions and 7 deletions

View File

@@ -12,9 +12,10 @@ apps_rename_cmd() {
local OLD_APP="$2"
local NEW_APP="$3"
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
local OLD_CACHE_DIR_ON_HOST="$DOKKU_ROOT_ON_HOST/$OLD_APP/cache"
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR"; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_DIR_ON_HOST:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi
rm -rf "$OLD_CACHE_DIR"
apps_create "$NEW_APP"