mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #2406 from dokku/2252-trigger-post-create
Use apps_create method when renaming an application. Closes #2252
This commit is contained in:
@@ -13,11 +13,11 @@ apps_rename_cmd() {
|
||||
local NEW_APP="$3"
|
||||
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$NEW_APP"
|
||||
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
|
||||
fi
|
||||
rm -rf "$OLD_CACHE_DIR"
|
||||
apps_create "$NEW_APP"
|
||||
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
|
||||
DOKKU_APPS_FORCE_DELETE=1 apps_destroy "$OLD_APP"
|
||||
[[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
|
||||
|
||||
Reference in New Issue
Block a user