Files
dokku/plugins/00_dokku-standard/commands
T

44 lines
981 B
Bash
Executable File

#!/bin/bash
set -e; case "$1" in
logs)
CONTAINER=$(</home/git/$2/CONTAINER)
docker logs $CONTAINER | tail -n 100
;;
run)
if [[ -z $2 ]]; then
echo "Please specify an app to run the command on"
exit 1
fi
APP="$2"; IMAGE="app/$APP"
if [[ ! -d "/home/git/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
shift 2
docker run -i -t $IMAGE /exec "$@"
;;
url)
APP="$2";
if [[ ! -d "/home/git/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -f "/home/git/$APP/URL" ]]; then
echo $(< "/home/git/$APP/URL")
fi
;;
help)
cat && cat<<EOF
logs <app> Show the last logs for an application
run <app> <cmd> Run a command in the environment of an application
url <app> Show the URL for an application
EOF
;;
esac
cat