Actualizar 'scripts/start-app.sh'

This commit is contained in:
Lopera Mendizabal 2024-04-18 15:56:14 +00:00
parent 05baac8db9
commit 58b39aa84e

View File

@ -0,0 +1,50 @@
#!/bin/bash
# Build de los microservicios con Maven
echo "Building microservices..."
cd ../shoptfront-productcatalogue-stockmanager-Kubernetes
minikube start
cd shoptfront
mvn clean package
cd ..
cd ../productcatalogue
mvn clean package
cd ..
cd ../stockmanager
mvn clean package
cd ..
# Creación de imágenes Docker
echo "Building Docker images..."
cd shoptfront
docker build -t shoptfront:latest .
cd ../productcatalogue
docker build -t productcatalogue:latest .
cd ../stockmanager
docker build -t stockmanager:latest .
cd ..
# Despliegue en Kubernetes
echo "Deploying to Kubernetes..."
kubectl apply -f shoptfront-productcatalogue-stockmanager-kubernetes/kubernetes/shopfront-service.yaml
kubectl apply -f shoptfront-productcatalogue-stockmanager-kubernetes/kubernetes/productcatalogue-service.yaml
kubectl apply -f shoptfront-productcatalogue-stockmanager-kubernetes/kubernetes/stockmanager-service.yaml
# Openning services
minikube service shoptfront-service.yaml
minikube service productcatalogue-service.yaml
minikube service stockmanager-service.yaml