Use DOKKU_ROOT instead of HOME.
HOME is not consistent if dokku is ran e.g. as root (for setup). The DOKKU_ROOT variable will also make it possible to have the repositories stored in an arbitrary location (works-ish right now)
This commit is contained in:
@@ -18,14 +18,14 @@ case "$1" in
|
||||
|
||||
git-*)
|
||||
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
|
||||
APP_PATH=$HOME/$APP
|
||||
APP_PATH=$DOKKU_ROOT/$APP
|
||||
|
||||
if [[ $1 == "git-receive-pack" && ! -d $APP_PATH ]]; then
|
||||
git init --bare $APP_PATH > /dev/null
|
||||
PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
|
||||
cat > $PRERECEIVE_HOOK <<EOF
|
||||
#!/bin/bash
|
||||
cat | dokku git-hook $APP
|
||||
cat | DOKKU_ROOT="$DOKKU_ROOT" dokku git-hook $APP
|
||||
EOF
|
||||
chmod +x $PRERECEIVE_HOOK
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user