diff --git a/scripts/start-app.sh b/scripts/start-app.sh index e69de29..31b024d 100644 --- a/scripts/start-app.sh +++ b/scripts/start-app.sh @@ -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 + + +