Replace gitreceive by a git plugin.

This removes the need for two distinct users.
Git pushes and dokku commands are sent using the same user.
This commit is contained in:
Paul Lietar
2013-10-27 22:35:19 +00:00
parent 6350f373be
commit 27d4bc8c3c
11 changed files with 64 additions and 39 deletions

View File

@@ -6,13 +6,13 @@ set -e; case "$1" in
exit 1
fi
APP="$2"; IMAGE="app/$APP";
if [[ ! -d "/home/git/$APP" ]]; then
if [[ ! -d "$HOME/$APP" ]]; then
echo "App does not exist"
exit 1
fi
pluginhook pre-delete $APP
ID=$(< "/home/git/$APP/CONTAINER")
ID=$(< "$HOME/$APP/CONTAINER")
docker stop $ID > /dev/null
docker images | grep $IMAGE | awk '{print $3}' | xargs docker rmi &> /dev/null &
@@ -22,7 +22,7 @@ set -e; case "$1" in
;;
logs)
CONTAINER=$(</home/git/$2/CONTAINER)
CONTAINER=$(<$HOME/$2/CONTAINER)
docker logs $CONTAINER | tail -n 100
;;
@@ -32,7 +32,7 @@ set -e; case "$1" in
exit 1
fi
APP="$2"; IMAGE="app/$APP"
if [[ ! -d "/home/git/$APP" ]]; then
if [[ ! -d "$HOME/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
@@ -42,13 +42,13 @@ set -e; case "$1" in
url)
APP="$2";
if [[ ! -d "/home/git/$APP" ]]; then
if [[ ! -d "$HOME/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -f "/home/git/$APP/URL" ]]; then
echo $(< "/home/git/$APP/URL")
if [[ -f "$HOME/$APP/URL" ]]; then
echo $(< "$HOME/$APP/URL")
fi
;;

View File

@@ -2,7 +2,7 @@
sed -i 's/docker -d$/docker -d -r=true/' /etc/init/docker.conf
echo $HOSTNAME > /home/git/HOSTNAME
echo $HOSTNAME > $HOME/HOSTNAME
# temporary hack for https://github.com/progrium/dokku/issues/82
@@ -14,6 +14,6 @@ start on (started docker)
script
sleep 2 # give docker some time
sudo -i -u git /usr/local/bin/dokku deploy:all
sudo -i -u dokku /usr/local/bin/dokku deploy:all
end script
EOF