dev #41

Merged
jjminguez merged 46 commits from dev into master 2026-04-16 15:34:49 +00:00
2 changed files with 15 additions and 9 deletions
Showing only changes of commit 03edd2c544 - Show all commits

View File

@@ -2,7 +2,7 @@ pipeline {
agent any
environment {
// Valores por defecto para evitar errores
// Valores iniciales por seguridad
CONTAINER_NAME = "django_app_dev"
PORT = "8000"
DEBUG_MODE = "1"
@@ -14,14 +14,14 @@ pipeline {
script {
if (env.BRANCH_NAME == 'master') {
echo "--- CONFIGURANDO MODO PRODUCCIÓN (MASTER) ---"
CONTAINER_NAME = "django_app_master"
PORT = "8001"
DEBUG_MODE = "0"
env.CONTAINER_NAME = "django_app_master"
env.PORT = "8001"
env.DEBUG_MODE = "0"
} else if (env.BRANCH_NAME == 'dev') {
echo "--- CONFIGURANDO MODO DESARROLLO (DEV) ---"
CONTAINER_NAME = "django_app_dev"
PORT = "8000"
DEBUG_MODE = "1"
env.CONTAINER_NAME = "django_app_dev"
env.PORT = "8000"
env.DEBUG_MODE = "1"
}
}
}
@@ -32,7 +32,8 @@ pipeline {
anyOf { branch 'dev'; branch 'master' }
}
steps {
// Usamos las variables que configuramos arriba
echo "Desplegando contenedor: ${env.CONTAINER_NAME} en puerto: ${env.PORT}"
// Ahora Docker Compose sí recibirá los valores correctamente
sh "docker compose -f deployments/docker-compose.yml up -d --build"
}
}

View File

@@ -11,4 +11,9 @@ services:
networks:
- frontend
ports:
- "${PORT}:8000"
- "${PORT}:8000"
# --- ESTA ES LA PARTE QUE FALTABA ---
networks:
frontend:
driver: bridge