Compare commits

..

15 Commits

Author SHA1 Message Date
6f84db00cd Merge pull request 'dev' (#7) from dev into master
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
Reviewed-on: #7
2026-04-12 02:53:09 +00:00
b37b581a78 Merge pull request 'pre-dev' (#6) from pre-dev into dev
Some checks failed
DEPLOY_MULTI_BRACH/pipeline/pr-master Build queued...
DEPLOY_MULTI_BRACH/pipeline/head There was a failure building this commit
Reviewed-on: #6
2026-04-12 02:52:00 +00:00
minguezsanzjuanjose
0971134702 Update docker-compose.yml
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-12 04:51:32 +02:00
minguezsanzjuanjose
02bc67c5fd Update docker-compose.yml
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-12 04:49:56 +02:00
c54e1e9b9e Merge pull request 'Update .env' (#5) from pre-dev into dev
Some checks failed
DEPLOY_MULTI_BRACH/pipeline/head There was a failure building this commit
Reviewed-on: #5
2026-04-12 02:46:57 +00:00
minguezsanzjuanjose
02feaf445d Update .env
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-12 04:46:31 +02:00
15f2a21a2c Merge pull request 'fix' (#4) from pre-dev into dev
Some checks failed
DEPLOY_MULTI_BRACH/pipeline/head There was a failure building this commit
Reviewed-on: #4
2026-04-12 02:43:35 +00:00
minguezsanzjuanjose
c8aa23b564 fix
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-12 04:43:02 +02:00
264c66c7c0 Merge pull request 'Update docker-compose.yml' (#3) from pre-dev into dev
Some checks failed
DEPLOY_MULTI_BRACH/pipeline/head There was a failure building this commit
Reviewed-on: #3
2026-04-12 02:39:57 +00:00
minguezsanzjuanjose
0ce0554443 Update docker-compose.yml
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-12 04:39:31 +02:00
16cbd85e7f Merge pull request 'fix' (#2) from pre-dev into dev
Some checks failed
DEPLOY_MULTI_BRACH/pipeline/head There was a failure building this commit
Reviewed-on: #2
2026-04-12 02:37:26 +00:00
minguezsanzjuanjose
375291514e fix
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-12 04:36:59 +02:00
14e2036bd0 Merge pull request 'pre-dev' (#1) from pre-dev into dev
Some checks failed
DEPLOY_MULTI_BRACH/pipeline/head There was a failure building this commit
Reviewed-on: #1
2026-04-12 02:25:14 +00:00
minguezsanzjuanjose
c9c54e6671 Update Jenkinsfile
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-12 04:20:03 +02:00
minguezsanzjuanjose
9804712643 Update README.md
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
2026-04-11 23:18:34 +02:00
4 changed files with 14 additions and 15 deletions

4
.env
View File

@@ -5,6 +5,6 @@ SECRET_KEY=una-clave-muy-secreta-y-larga-123456
# Base de Datos (Conectando al PostgreSQL que instalamos) # Base de Datos (Conectando al PostgreSQL que instalamos)
DB_NAME=gitea DB_NAME=gitea
DB_USER=gitea DB_USER=gitea
DB_PASSWORD=gitea_password DB_PASSWORD=gitea
DB_HOST=db DB_HOST=gitea-db
DB_PORT=5432 DB_PORT=5432

View File

@@ -1,6 +1,6 @@
# django-core-base # django-core-base
// V-Encore Lab: Sistema Automatizado v1.0.3 // V-Encore Lab: Sistema Automatizado v1.0.4

View File

@@ -6,12 +6,12 @@ pipeline {
steps { steps {
script { script {
if (env.BRANCH_NAME == 'master') { if (env.BRANCH_NAME == 'master') {
env.PROJECT_NAME = "django_master" // <--- Nombre único env.PROJECT_NAME = "django_master"
env.CONTAINER_NAME = "django_app_master" env.CONTAINER_NAME = "django_app_master"
env.PORT = "8001" env.PORT = "8001"
env.DEBUG_MODE = "0" env.DEBUG_MODE = "0"
} else { } else {
env.PROJECT_NAME = "django_dev" // <--- Nombre único env.PROJECT_NAME = "django_dev"
env.CONTAINER_NAME = "django_app_dev" env.CONTAINER_NAME = "django_app_dev"
env.PORT = "8000" env.PORT = "8000"
env.DEBUG_MODE = "1" env.DEBUG_MODE = "1"
@@ -25,15 +25,14 @@ pipeline {
steps { steps {
echo "DESPLEGANDO: ${env.CONTAINER_NAME} en el puerto ${env.PORT}" echo "DESPLEGANDO: ${env.CONTAINER_NAME} en el puerto ${env.PORT}"
// 1. Levantamos el contenedor con su nombre de proyecto único (-p) // Usamos docker-compose con guion para asegurar compatibilidad
sh """ sh """
CONTAINER_NAME=${env.CONTAINER_NAME} \ CONTAINER_NAME=${env.CONTAINER_NAME} \
PORT=${env.PORT} \ PORT=${env.PORT} \
DEBUG_MODE=${env.DEBUG_MODE} \ DEBUG_MODE=${env.DEBUG_MODE} \
docker compose -p ${env.PROJECT_NAME} -f deployments/docker-compose.yml up -d --build web docker-compose -p ${env.PROJECT_NAME} -f deployments/docker-compose.yml up -d --build web
""" """
// 2. Ejecutamos migraciones automáticamente al terminar
echo "Ejecutando migraciones en ${env.CONTAINER_NAME}..." echo "Ejecutando migraciones en ${env.CONTAINER_NAME}..."
sh "docker exec ${env.CONTAINER_NAME} python manage.py migrate --noinput" sh "docker exec ${env.CONTAINER_NAME} python manage.py migrate --noinput"
} }

View File

@@ -5,21 +5,21 @@ services:
dockerfile: deployments/Dockerfile dockerfile: deployments/Dockerfile
container_name: ${CONTAINER_NAME} container_name: ${CONTAINER_NAME}
restart: always restart: always
working_dir: /app # <--- Vital para que encuentre 'core' working_dir: /app
environment: environment:
- DEBUG=${DEBUG_MODE} - DEBUG=${DEBUG_MODE}
- PYTHONPATH=/app # <--- Asegura que Python vea las carpetas - PYTHONPATH=/app
- DB_NAME=gitea - DB_NAME=gitea
- DB_USER=gitea - DB_USER=gitea
- DB_PASSWORD=gitea - DB_PASSWORD=gitea # <-- Asegúrate de que esta sea la que pusiste en la web de Gitea
- DB_HOST=gitea-db-1 - DB_HOST=gitea-db # <-- IMPORTANTE: Nombre del servicio, sin el "-1"
- DB_PORT=5432 - DB_PORT=5432
networks: networks:
- gitea_net - gitea_bridge # <-- Conectamos el servicio a nuestro puente
ports: ports:
- "${PORT}:8000" - "${PORT}:8000"
networks: networks:
gitea_net: gitea_bridge: # <-- Definimos el puente
external: true external: true
name: frontend name: root_gitea_gitea # <-- ESTE es el nombre real que sale en tu 'docker network ls'