mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-22 06:23:01 +00:00
[build] Add database task
This commit is contained in:
parent
42c69cb10c
commit
c209bc662b
1 changed files with 12 additions and 1 deletions
13
build
13
build
|
@ -35,7 +35,7 @@ if [[ "$#" -lt 1 ]]; then
|
||||||
echo -e "";
|
echo -e "";
|
||||||
echo -e "${CSECTION}Available actions${RS}";
|
echo -e "${CSECTION}Available actions${RS}";
|
||||||
echo -e " ${CACTION}setup${RS} - Perform initial setup";
|
echo -e " ${CACTION}setup${RS} - Perform initial setup";
|
||||||
echo -e " ${CACTION}setup-dev${RS} - Performa additional setup for development environments. Run after ${CACTION}setup${RS}.";
|
echo -e " ${CACTION}setup-dev${RS} - Perform additional setup for development environments. Run after ${CACTION}setup${RS}.";
|
||||||
echo -e " ${CACTION}database${RS} - Connect to the database via SSH & open MariaDB CLI connection, prompting for a password";
|
echo -e " ${CACTION}database${RS} - Connect to the database via SSH & open MariaDB CLI connection, prompting for a password";
|
||||||
echo -e " ${CACTION}dev-server${RS} - Start a development server";
|
echo -e " ${CACTION}dev-server${RS} - Start a development server";
|
||||||
echo -e " ${CACTION}dev-server-stop${RS} - Stop the currently running development server";
|
echo -e " ${CACTION}dev-server-stop${RS} - Stop the currently running development server";
|
||||||
|
@ -73,6 +73,17 @@ function task_setup {
|
||||||
stage_end $?;
|
stage_end $?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function task_database {
|
||||||
|
task_begin "Connecting to the database";
|
||||||
|
|
||||||
|
ssh -TN db.connectedhumber.org -L 3306:localhost:3306 &
|
||||||
|
ssh_pid=$!;
|
||||||
|
mysql --host localhost --port 3306 -u "${USER}" -p;
|
||||||
|
|
||||||
|
kill $!; wait; sleep 0.5;
|
||||||
|
task_end $?;
|
||||||
|
}
|
||||||
|
|
||||||
function task_setup-dev {
|
function task_setup-dev {
|
||||||
task_begin "Checking environment";
|
task_begin "Checking environment";
|
||||||
check_command mysql true optional;
|
check_command mysql true optional;
|
||||||
|
|
Loading…
Reference in a new issue