diff --git a/infra/tools/taskfile/Taskfile.yaml b/infra/tools/taskfile/Taskfile.yaml index 7e9f7a2b..006185bf 100644 --- a/infra/tools/taskfile/Taskfile.yaml +++ b/infra/tools/taskfile/Taskfile.yaml @@ -6,10 +6,6 @@ vars: NAMESPACE: sh: kubectl get ns | grep -v -e maxwell -e NAME -e slack-devbot-helper | awk '{ print $1 }' -env: - APP_NAME: - sh: make get-app-name - tasks: destroy-dev: desc: Destroy dev @@ -21,6 +17,9 @@ tasks: create-mysql-db: desc: Create a MySQL DB ignore_error: true + env: + APP_NAME: + sh: make get-app-name cmds: - | mysql -h ${LOGIN_DB_HOST} -u root -p${LOGIN_DB_PASSWORD} -e "CREATE DATABASE IF NOT EXISTS ${APP_NAME}_${DB_NAME}; @@ -32,6 +31,8 @@ tasks: ignore_error: true env: PGPASSWORD: '{{.LOGIN_DB_PASSWORD}}' + APP_NAME: + sh: make get-app-name cmds: - | #!/bin/bash @@ -48,6 +49,8 @@ tasks: ignore_error: true env: PGPASSWORD: '{{.LOGIN_DB_PASSWORD}}' + APP_NAME: + sh: make get-app-name cmds: - | #!/bin/bash @@ -58,6 +61,9 @@ tasks: delete-mysql-db: desc: "Delete a Single Mysql DB" ignore_error: true + env: + APP_NAME: + sh: make get-app-name cmds: - | #!/bin/bash @@ -73,6 +79,7 @@ tasks: - | #!/bin/bash databases=$(mysql -h ${LOGIN_DB_HOST} -u root -p${LOGIN_DB_PASSWORD} -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema|mysql|sys)") + # Loop through each database and drop it for db in $databases; do echo "Dropping database: $db"