upd bash files

This commit is contained in:
oleh 2025-04-09 10:56:01 +02:00
parent 8af8d1ceab
commit 31d49d2fcb
4 changed files with 15 additions and 15 deletions

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
echo "Building Docker image for backend..." echo "Building Docker image for backend"
docker build -t battleship-backend ./backend docker build -t battleship-backend ./backend
echo "Building Docker image for frontend..." echo "Building Docker image for frontend"
docker build -t battleship-frontend ./frontend docker build -t battleship-frontend ./frontend
echo "Docker images built." echo "Docker images built."

View File

@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
echo "Deleting Services for MySQL, backend, and frontend..." echo "Deleting Services for MySQL, backend, and frontend"
kubectl delete -f service.yaml -n battleship-app kubectl delete -f service.yaml -n battleship-app
echo "Deleting StatefulSet for MySQL..." echo "Deleting StatefulSet for MySQL"
kubectl delete -f statefulset.yaml -n battleship-app kubectl delete -f statefulset.yaml -n battleship-app
echo "Deleting Deployments for backend and frontend..." echo "Deleting Deployments for backend and frontend"
kubectl delete -f deployment.yaml -n battleship-app kubectl delete -f deployment.yaml -n battleship-app
echo "Deleting namespace battleship-app (and all objects within it)..." echo "Deleting namespace battleship-app"
kubectl delete -f namespace.yaml kubectl delete -f namespace.yaml
echo "Application completely removed from Kubernetes." echo "Application completely removed from Kubernetes."

View File

@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
echo "Creating namespace battleship-app..." echo "Creating namespace battleship-app"
kubectl apply -f namespace.yaml kubectl apply -f namespace.yaml
echo "Creating Deployment for backend and frontend..." echo "Creating Deployment for backend and frontend"
kubectl apply -f deployment.yaml -n battleship-app kubectl apply -f deployment.yaml -n battleship-app
echo "Creating StatefulSet for MySQL..." echo "Creating StatefulSet for MySQL"
kubectl apply -f statefulset.yaml -n battleship-app kubectl apply -f statefulset.yaml -n battleship-app
echo "Creating Service for MySQL, backend, and frontend..." echo "Creating Service for MySQL, backend, and frontend"
kubectl apply -f service.yaml -n battleship-app kubectl apply -f service.yaml -n battleship-app
echo "Application deployed in Kubernetes." echo "Application deployed in Kubernetes."

View File

@ -1,13 +1,13 @@
#!/bin/bash #!/bin/bash
echo "Stopping the application by scaling down to 0 replicas..." echo "Stopping the application by scaling down to 0 replicas"
echo "Scaling down the Deployment for backend to 0..." echo "Scaling down the Deployment for backend to 0"
kubectl scale deployment battleship-backend -n battleship-app --replicas=0 kubectl scale deployment battleship-backend -n battleship-app --replicas=0
echo "Scaling down the Deployment for frontend to 0..." echo "Scaling down the Deployment for frontend to 0"
kubectl scale deployment battleship-frontend -n battleship-app --replicas=0 kubectl scale deployment battleship-frontend -n battleship-app --replicas=0
echo "Scaling down the StatefulSet for MySQL to 0..." echo "Scaling down the StatefulSet for MySQL to 0"
kubectl scale statefulset battleship-mysql -n battleship-app --replicas=0 kubectl scale statefulset battleship-mysql -n battleship-app --replicas=0
echo "Application stopped, data (e.g., database) is preserved." echo "Application stopped, data is preserved."