Răsfoiți Sursa

Funciona en Openshift

Celestino Rey 1 an în urmă
părinte
comite
dd5e47e1f5

+ 1 - 1
K8S/Makefile.OC

@@ -1,7 +1,7 @@
 export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
 export REGISTRY=registry.reymota.es
 
-export IMG_VERSION = 0.90.21
+export IMG_VERSION = 0.90.23
 
 # limpia todo
 all: ayuda

+ 1 - 0
K8S/db-deployment.yaml

@@ -6,6 +6,7 @@ metadata:
     kompose.version: 1.34.0 (cbf2835db)
   labels:
     io.kompose.service: postgresql
+    app.kubernetes.io/part-of: jugaralpadel
   name: postgresql
   namespace: jugaralpadel
 spec:

+ 1 - 1
K8S/env-prod-configmap.yaml

@@ -1,7 +1,7 @@
 apiVersion: v1
 data:
   DEBUG: "False"
-  APP_VERSION: 16.0.1
+  APP_VERSION: 16.0.3
   SQL_DATABASE: reymota
   SQL_ENGINE: django.db.backends.postgresql
   SQL_HOST: postgresql

+ 1 - 0
K8S/jugaralpadel-deployment.yaml

@@ -31,6 +31,7 @@ metadata:
   namespace: jugaralpadel
   labels:
     app: jugaralpadel
+    app.kubernetes.io/part-of: jugaralpadel
 spec:
   replicas: 1
   selector:

+ 24 - 0
src/config/entrypoint.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+RUN_PORT="8000"
+
+export PATH=/opt/venv/bin:$PATH
+
+if [ "$DATABASE" = "postgres" ]
+then
+    echo "Waiting for postgres..."
+
+    while ! nc -z $SQL_HOST $SQL_PORT; do
+      sleep 0.1
+    done
+
+    echo "PostgreSQL started"
+
+	/opt/venv/bin/python manage.py migrate --no-input
+	/opt/venv/bin/python manage.py collectstatic --no-input
+
+	/opt/venv/bin/gunicorn misfinanzas.wsgi:application --bind "0.0.0.0:${RUN_PORT}" --daemon
+
+	nginx -g 'daemon off;'
+else
+    echo "la base de datos no es postgres: '$DATABASE'"
+fi

+ 2 - 1
src/gestion_reservas/views.py

@@ -72,7 +72,8 @@ def acerca_de(request):
     context = {
         "app_name": settings.APP_NAME,
         "app_version": settings.APP_VERSION,
-        "img_version": settings.IMG_VERSION
+        "img_version": settings.IMG_VERSION,
+        "comienzo_temporada": settings.MES_COMIENZO_TEMPORADA
     }
     return render(request, "acerca_de.html", context)
 

+ 1 - 0
src/templates/acerca_de.html

@@ -18,6 +18,7 @@
                     {% else %}
                         <li><strong>Versión de la imagen:</strong> {{ img_version }}</li>
                     {% endif %}
+                        <li><strong>Mes de comienzo de temporada:</strong> {{ comienzo_temporada }}</li>
 
                     </ul>
                 </div><!--//app-card-body-->