Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function _show_help {
echo " nginx <args...> Execute a 'nginx' command in the 'Portal' container. All <args...> are passed to nginx."
echo ""
echo " Database:"
echo " db Enter 'mysql' client CLI to the default database to make queries."
echo " db-shell Start a shell on the 'database' container."
echo " db-dump <database> Dump to standard output the <database> database of the 'database' container."
echo " db-execute <database> Execute the SQL script from standard input on the <database> database of the 'database' container."
Expand Down Expand Up @@ -118,6 +119,19 @@ function wp-cli {
_docker_compose exec -w /var/www/html portal wp "$@"
}

function db {
database="$1"
if [[ -z "$database" ]]; then
database="climatedata"
fi
echo "Connecting to MySQL '${database}' database. This should only work in development mode"
echo ""
echo " Reminder: to exit, use CTRL+D key combination"
echo ""

_docker_compose exec -it db mysql -p'root' "$database"
}

function db-shell {
_docker_compose exec -it db bash
}
Expand Down