Skip to content

Commit

Permalink
Adding a few more useful commands to vessel
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpolito committed Feb 2, 2018
1 parent b1d9913 commit 91aae3c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docker-files/vessel
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,44 @@ if [ $# -gt 0 ]; then
mysqldump -h mysql -u root -p$DB_PASSWORD --default-character-set=utf8mb4 $DB_DATABASE | grep -v "mysqldump: \[Warning\]"
fi

# If "node" is used, run node
# from our node container
elif [ "$1" == "node" ]; then
shift 1
$COMPOSE run --rm \
node \
node "$@"

# If "php" is used, pass-thru to "php"
# inside a new container
elif [ "$1" == "php" ]; then
shift 1
if [ "$EXEC" == "yes" ]; then
$COMPOSE exec \
-u vessel \
app \
php "$@"
else
$COMPOSE run --rm \
app \
php "$@"
fi

# If "ssh" is used, pass-thru to "ssh"
# inside a new container
elif [ "$1" == "ssh" ]; then
shift 1
if [ "$EXEC" == "yes" ] && [ "$1" != "node" ]; then
$COMPOSE exec \
-u vessel \
$1 \
bash
else
$COMPOSE run --rm \
$1 \
bash
fi

# Else, pass-thru args to docker-compose
else
$COMPOSE "$@"
Expand Down

0 comments on commit 91aae3c

Please sign in to comment.