From c46efa54b4b38870976074748c980eb3f32b067d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 13 Dec 2017 00:42:45 -0500 Subject: [PATCH 1/3] fix: do not copy the cache directory to cloned applications --- plugins/apps/subcommands/clone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apps/subcommands/clone b/plugins/apps/subcommands/clone index d07d4e20c..801ffa696 100755 --- a/plugins/apps/subcommands/clone +++ b/plugins/apps/subcommands/clone @@ -22,7 +22,7 @@ apps_clone_cmd() { apps_create "$NEW_APP" pushd "$DOKKU_ROOT/$OLD_APP/." > /dev/null - find ./* -not \( -name .cache \) | cpio -pvdmu "$DOKKU_ROOT/$NEW_APP" + find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pvdmu "$DOKKU_ROOT/$NEW_APP" popd > /dev/null if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then From fe6f33989061bdb6022c7a6cfeb83c687658cfad Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 13 Dec 2017 00:43:18 -0500 Subject: [PATCH 2/3] feat: silence cpio --- plugins/apps/subcommands/clone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apps/subcommands/clone b/plugins/apps/subcommands/clone index 801ffa696..d19637c74 100755 --- a/plugins/apps/subcommands/clone +++ b/plugins/apps/subcommands/clone @@ -22,7 +22,7 @@ apps_clone_cmd() { apps_create "$NEW_APP" pushd "$DOKKU_ROOT/$OLD_APP/." > /dev/null - find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pvdmu "$DOKKU_ROOT/$NEW_APP" + find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP" popd > /dev/null if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then From 6528c4511ac8abecf74174e9205a9637c4f7df37 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 13 Dec 2017 00:44:11 -0500 Subject: [PATCH 3/3] fix: handle case in ubuntu 16.04 where popd may fail if the dokku user does not have rights to execute in the executing user's $PWD. Closes #2978 --- plugins/apps/subcommands/clone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apps/subcommands/clone b/plugins/apps/subcommands/clone index d19637c74..1223aeb32 100755 --- a/plugins/apps/subcommands/clone +++ b/plugins/apps/subcommands/clone @@ -23,7 +23,7 @@ apps_clone_cmd() { apps_create "$NEW_APP" pushd "$DOKKU_ROOT/$OLD_APP/." > /dev/null find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP" - popd > /dev/null + popd > /dev/null 2>&1 || pushd "/tmp" > /dev/null if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache