Use DOKKU_ROOT instead of HOME.

HOME is not consistent if dokku is ran e.g. as root (for setup).
The DOKKU_ROOT variable will also make it possible to have the repositories stored in an arbitrary location (works-ish right now)
This commit is contained in:
Paul Lietar committed 2013-10-28 21:15:17 +00:00
1 parent e04f271d8e
commit b5c8dd7436
8 files changed
+37 -35

No files matched your search

+7 -7
View File
@@ -6,13 +6,13 @@ set -e; case "$1" in
exit 1
fi
APP="$2"; IMAGE="app/$APP";
if [[ ! -d "$HOME/$APP" ]]; then
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App does not exist"
exit 1
fi
pluginhook pre-delete $APP
ID=$(< "$HOME/$APP/CONTAINER")
ID=$(< "$DOKKU_ROOT/$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/$2/CONTAINER)
CONTAINER=$(<$DOKKU_ROOT/$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/$APP" ]]; then
if [[ ! -d "$DOKKU_ROOT/$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/$APP" ]]; then
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -f "$HOME/$APP/URL" ]]; then
echo $(< "$HOME/$APP/URL")
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
echo $(< "$DOKKU_ROOT/$APP/URL")
fi
;;
+1 -1
View File
@@ -2,7 +2,7 @@
sed -i 's/docker -d$/docker -d -r=true/' /etc/init/docker.conf
echo $HOSTNAME > $HOME/HOSTNAME
echo $HOSTNAME > $DOKKU_ROOT/HOSTNAME
# temporary hack for https://github.com/progrium/dokku/issues/82
+1 -1
View File
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
[[ -n $1 ]] && rm -r "/home/git/$1" > /dev/null
[[ -n $1 ]] && rm -r "$DOKKU_ROOT/$1" > /dev/null