Merge pull request #273 from plietar/logs-f
Add an option to follow the logs.
This commit is contained in:
commit
d71cd77f7a
2 files changed
+16
-2
No files matched your search
@@ -10,6 +10,7 @@ Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
|||||||
Leo Unbekandt <leo@unbekandt.eu>
|
Leo Unbekandt <leo@unbekandt.eu>
|
||||||
Luigi Maselli <grigio.org@gmail.com>
|
Luigi Maselli <grigio.org@gmail.com>
|
||||||
Martin Weiss <kornnflake@gmail.com>
|
Martin Weiss <kornnflake@gmail.com>
|
||||||
|
Paul Lietar <paul@lietar.net>
|
||||||
Rajiv Makhijani <rajiv@blue-tech.org>
|
Rajiv Makhijani <rajiv@blue-tech.org>
|
||||||
rhy-jot <rhy-jot@myeml.net>
|
rhy-jot <rhy-jot@myeml.net>
|
||||||
Richard North <rich.north@gmail.com>
|
Richard North <rich.north@gmail.com>
|
||||||
|
|||||||
@@ -23,8 +23,21 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
logs)
|
logs)
|
||||||
CONTAINER=$(<$DOKKU_ROOT/$2/CONTAINER)
|
if [[ -z $2 ]]; then
|
||||||
|
echo "Please specify an app to run the command on"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
APP="$2";
|
||||||
|
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
||||||
|
echo "App $APP does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
|
||||||
docker logs $CONTAINER | tail -n 100
|
docker logs $CONTAINER | tail -n 100
|
||||||
|
if [[ $3 == "-t" ]]; then
|
||||||
|
docker attach $CONTAINER
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
run)
|
run)
|
||||||
@@ -56,7 +69,7 @@ case "$1" in
|
|||||||
help)
|
help)
|
||||||
cat && cat<<EOF
|
cat && cat<<EOF
|
||||||
delete <app> Delete an application
|
delete <app> Delete an application
|
||||||
logs <app> Show the last logs for an application
|
logs <app> [-t] Show the last logs for an application (-t follows)
|
||||||
run <app> <cmd> Run a command in the environment of an application
|
run <app> <cmd> Run a command in the environment of an application
|
||||||
url <app> Show the URL for an application
|
url <app> Show the URL for an application
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in new issue
Block a user