Add git pull support

This commit is contained in:
Will Boyce
2014-10-18 02:25:23 +01:00
committed by Jose Diaz-Gonzalez
parent 53c58ec8b9
commit ad497191df
2 changed files with 8 additions and 1 deletions

7
dokku
View File

@@ -38,6 +38,13 @@ case "$1" in
echo
;;
git-upload-pack)
APP=${2//"'"/} # strip single quotes from the app name: 'app_name' -> app_name
pluginhook pre-pull $APP
cat | git-upload-pack "$DOKKU_ROOT/$APP"
pluginhook post-pull $APP
;;
build)
APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
id=$(cat | docker run -i -a stdin $DOKKU_DISTRO /bin/bash -c "mkdir -p /app && tar -xC /app")

View File

@@ -6,7 +6,7 @@ git_archive_all() {
TMP_WORK_DIR=$(mktemp -d)
chmod 755 $TMP_WORK_DIR
unset GIT_DIR GIT_WORK_TREE
git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null
git clone -q $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null
pushd $TMP_WORK_DIR > /dev/null
git config advice.detachedHead false
git checkout $REV &> /dev/null