fix: remove CONTAINER files on app clone

This will ensure we don't accidentally destroy old applications if the new app isn't rebuilt or the rebuild fails.

Closes #3249
This commit is contained in:
Jose Diaz-Gonzalez
2018-12-27 05:02:23 -05:00
parent cfd8f237df
commit f3a33e74d7

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
scheduler-docker-local-post-app-clone-setup() {
declare desc="removes docker-local files when setting up a clone"
declare OLD_APP="$1" NEW_APP="$2"
local APP_DIR="$DOKKU_ROOT/$NEW_APP"
find "$APP_DIR" -type f -name 'CONTAINER.*' -exec rm {} \;
}
scheduler-docker-local-post-app-clone-setup "$@"