Introduce DOKKU_ROOT and import now in git plugin

This commit is contained in:
Alexander
2013-11-14 23:51:35 +01:00
parent 682229baae
commit 2219044114
5 changed files with 27 additions and 8 deletions

17
plugins/git/backup-import Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
APPS="$4"
while read APP; do
APP_PATH="$TARGET_DIR/$APP";
git init --bare $APP_PATH > /dev/null
PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
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
done < $APPS > /dev/null