zkt24/Ekart/scripts/run-app.sh

51 lines
1.1 KiB
Bash
Raw Normal View History

2024-04-18 15:55:23 +00:00
#!/bin/bash
2024-04-12 08:56:06 +00:00
2024-04-18 15:55:23 +00:00
# Build de los microservicios con Maven
echo "Building microservices..."
cd ../shoptfront-productcatalogue-stockmanager-Kubernetes
2024-04-12 08:56:06 +00:00
2024-04-18 15:55:23 +00:00
minikube start
cd shoptfront
mvn clean package
cd ..
cd ../productcatalogue
mvn clean package
cd ..
cd ../stockmanager
2024-04-12 08:56:06 +00:00
mvn clean package
2024-04-18 15:55:23 +00:00
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
2024-04-12 08:56:06 +00:00