Skip to content

Commit

Permalink
merged in duplicate php command and cleaned up mysql command similar …
Browse files Browse the repository at this point in the history
…to mysqldump
  • Loading branch information
fideloper committed Sep 14, 2018
1 parent 6584e6b commit 01e55a4
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions docker-files/vessel
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ if [ $# -gt 0 ]; then
app \
php artisan tinker
fi

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

# If "npm" is used, run npm
# from our node container
Expand Down Expand Up @@ -263,38 +271,17 @@ if [ $# -gt 0 ]; then
if [ "$EXEC" == "yes" ]; then
$COMPOSE exec \
mysql \
mysql -u root -p$DB_PASSWORD $DB_DATABASE $@"
bash -c 'MYSQL_PWD=$MYSQL_ROOT_PASSWORD mysql -u root $MYSQL_DATABASE'
else
$COMPOSE run --rm \
mysql \
mysql -u root -p$DB_PASSWORD $DB_DATABASE $@"
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 "$@"
bash -c 'MYSQL_PWD=$MYSQL_ROOT_PASSWORD mysql -u root $MYSQL_DATABASE'
fi

# If "ssh" is used, pass-thru to "ssh"
# inside a new container
# e.g.: ./vessel ssh app
# e.g.: ./vessel ssh mysql
elif [ "$1" == "ssh" ]; then
shift 1
if [ "$EXEC" == "yes" ] && [ "$1" != "node" ]; then
Expand Down

0 comments on commit 01e55a4

Please sign in to comment.