refactor: move pre-receive hook modification to post-app-clone-setup trigger
This commit is contained in:
1 parent
5801fd98a4
commit
5dd297bb49
2 files changed
+13
-1
No files matched your search
@@ -49,7 +49,6 @@ cmd-apps-clone() {
|
|||||||
fi
|
fi
|
||||||
rm -rf "$NEW_CACHE_DIR"
|
rm -rf "$NEW_CACHE_DIR"
|
||||||
|
|
||||||
[[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
|
|
||||||
[[ "$SKIP_REBUILD" == "true" ]] || ps_rebuild "$NEW_APP"
|
[[ "$SKIP_REBUILD" == "true" ]] || ps_rebuild "$NEW_APP"
|
||||||
plugn trigger post-app-clone "$OLD_APP" "$NEW_APP"
|
plugn trigger post-app-clone "$OLD_APP" "$NEW_APP"
|
||||||
dokku_log_info1_quiet "Cloning $OLD_APP to $NEW_APP... done"
|
dokku_log_info1_quiet "Cloning $OLD_APP to $NEW_APP... done"
|
||||||
|
|||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
trigger-git-post-app-clone-setup() {
|
||||||
|
declare desc="modifies git-hook"
|
||||||
|
declare trigger="post-app-clone-setup"
|
||||||
|
declare OLD_APP="$1" NEW_APP="$2"
|
||||||
|
|
||||||
|
[[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger-git-post-app-clone-setup "$@"
|
||||||
Reference in new issue
Block a user