Fix para Build local
Some checks failed
Optimized Build and Deploy / remote-build-and-deploy (push) Failing after 17s
Some checks failed
Optimized Build and Deploy / remote-build-and-deploy (push) Failing after 17s
This commit is contained in:
@@ -43,7 +43,7 @@ jobs:
|
|||||||
mkdir -p "$KANIKO_CACHE_BACKEND" "$KANIKO_CACHE_FRONTEND"
|
mkdir -p "$KANIKO_CACHE_BACKEND" "$KANIKO_CACHE_FRONTEND"
|
||||||
chmod 777 "$KANIKO_CACHE_BACKEND" "$KANIKO_CACHE_FRONTEND"
|
chmod 777 "$KANIKO_CACHE_BACKEND" "$KANIKO_CACHE_FRONTEND"
|
||||||
|
|
||||||
# 3. Construcción paralela con Kaniko (caché activada)
|
# 3. Construcción paralela con Kaniko (solo build local)
|
||||||
build_image() {
|
build_image() {
|
||||||
local context=$1
|
local context=$1
|
||||||
local dockerfile=$2
|
local dockerfile=$2
|
||||||
@@ -59,20 +59,25 @@ jobs:
|
|||||||
--dockerfile="/workspace/$dockerfile" \
|
--dockerfile="/workspace/$dockerfile" \
|
||||||
--cache=true \
|
--cache=true \
|
||||||
--cache-dir=/cache \
|
--cache-dir=/cache \
|
||||||
|
--no-push \
|
||||||
--destination="$image_name" \
|
--destination="$image_name" \
|
||||||
--tarPath="/workspace/$tar_path"
|
--tarPath="/workspace/$tar_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Construyendo imágenes en paralelo..."
|
echo "Construyendo imágenes en paralelo..."
|
||||||
(build_image "." "Backend/GestionIntegral.Api/Dockerfile" "$KANIKO_CACHE_BACKEND" "dmolinari/gestionintegralweb-backend:latest" "backend.tar") &
|
(build_image "." "Backend/GestionIntegral.Api/Dockerfile" "$KANIKO_CACHE_BACKEND" "gestionintegralweb-backend:latest" "backend.tar") &
|
||||||
(build_image "." "Frontend/Dockerfile" "$KANIKO_CACHE_FRONTEND" "dmolinari/gestionintegralweb-frontend:latest" "frontend.tar") &
|
(build_image "." "Frontend/Dockerfile" "$KANIKO_CACHE_FRONTEND" "gestionintegralweb-frontend:latest" "frontend.tar") &
|
||||||
wait
|
wait
|
||||||
|
|
||||||
# 4. Cargar imágenes
|
# 4. Cargar imágenes y etiquetar correctamente
|
||||||
echo "Cargando imágenes en Docker..."
|
echo "Cargando y etiquetando imágenes..."
|
||||||
docker load -i "$TEMP_DIR/backend.tar"
|
docker load -i "$TEMP_DIR/backend.tar"
|
||||||
docker load -i "$TEMP_DIR/frontend.tar"
|
docker load -i "$TEMP_DIR/frontend.tar"
|
||||||
|
|
||||||
|
# Etiquetar las imágenes para que coincidan con docker-compose
|
||||||
|
docker tag gestionintegralweb-backend:latest dmolinari/gestionintegralweb-backend:latest
|
||||||
|
docker tag gestionintegralweb-frontend:latest dmolinari/gestionintegralweb-frontend:latest
|
||||||
|
|
||||||
# 5. Despliegue con Docker Compose
|
# 5. Despliegue con Docker Compose
|
||||||
cd /opt/gestion-integral
|
cd /opt/gestion-integral
|
||||||
export DB_SA_PASSWORD='${{ secrets.DB_SA_PASSWORD_SECRET }}'
|
export DB_SA_PASSWORD='${{ secrets.DB_SA_PASSWORD_SECRET }}'
|
||||||
|
|||||||
Reference in New Issue
Block a user