I want to write a shell script where I will enter any gcloud
side environment and I will have multiple docker images that will be running. I will enter as a bash mode in any container and then run the gcloud connect MySQL
command which is nothing but a Rubik
. How can I enter these using a shell script
? The script I have written is like a plain simple::
#!/bin/bash
echo "Executing cluster"
docker exec -ti cluster-name bash
echo "Starting a connection to gcloud mysql"
gcloud sql connect ql03-ee102-mysql --user=root --quiet.
The command is running till "docker exec -ti cluster-name bash" and entering the bash mode inside Rubik but stops running after that and do not run the next statements. If it does then I can create other DB scripts. How Do I achieve it? I am stuck. Any helo would be highly appreciated.