Merge pull request #4297 from dokku/git-sync

Add support for cloning/syncing from a remote repository
This commit is contained in:
Jose Diaz-Gonzalez
2021-01-20 13:36:15 -05:00
committed by GitHub
16 changed files with 540 additions and 33 deletions

View File

@@ -234,22 +234,3 @@ cmd-git-glob() {
fi
git-shell -c "$args"
}
fn-git-create-hook() {
declare APP="$1"
local APP_PATH="$DOKKU_ROOT/$APP"
local PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
if [[ ! -d "$APP_PATH/refs" ]]; then
git init --bare "$APP_PATH" >/dev/null
fi
cat >"$PRERECEIVE_HOOK" <<EOF
#!/usr/bin/env bash
set -e
set -o pipefail
cat | DOKKU_ROOT="$DOKKU_ROOT" dokku git-hook $APP
EOF
chmod +x "$PRERECEIVE_HOOK"
}