fix: Add a trigger to allow plugins to cleanup after a new clone is created

This commit is contained in:
Jose Diaz-Gonzalez
2018-12-27 04:58:43 -05:00
parent 86cc15d285
commit 0498a707c8
3 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1 @@
hook

View File

@@ -39,6 +39,7 @@ apps_clone_cmd() {
pushd "$DOKKU_ROOT/$OLD_APP/." > /dev/null
find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP"
popd > /dev/null 2>&1 || pushd "/tmp" > /dev/null
plugn trigger post-app-clone-setup "$OLD_APP" "$NEW_APP"
if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache