#!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x case "$1" in git-hook) APP=$2 while read oldrev newrev refname do # Only run this script for the master branch. You can remove this # if block if you wish to run it for others as well. if [[ $refname = "refs/heads/master" ]] ; then git archive $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/" fi done ;; git-*) APP="$(echo $2 | perl -pe 's/(? /dev/null PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive" cat > $PRERECEIVE_HOOK <