diff --git a/K8S/Makefile b/K8S/Makefile index 785b7a2..da4963c 100644 --- a/K8S/Makefile +++ b/K8S/Makefile @@ -1,8 +1,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.70 +export IMG_VERSION = 0.72 export IMG_NGINX_VERSION = 1.0 -export APP_VERSION = 12.0 # limpia todo all: imagen clean install diff --git a/K8S/env-prod-configmap.yaml b/K8S/env-prod-configmap.yaml index e10eec3..44ea5c7 100644 --- a/K8S/env-prod-configmap.yaml +++ b/K8S/env-prod-configmap.yaml @@ -2,6 +2,7 @@ apiVersion: v1 data: DEBUG: "False" ENTORNO: "Producción" + APP_VERSION: 15.0.0 SECRET_KEY: change_me SQL_HOST: postgresql SQL_PORT: "5432" diff --git a/K8S/reymota-deployment.yaml b/K8S/reymota-deployment.yaml index b9994bc..c825c1c 100644 --- a/K8S/reymota-deployment.yaml +++ b/K8S/reymota-deployment.yaml @@ -39,8 +39,8 @@ spec: name: reymota image: $REGISTRY/reymota-$ARQUITECTURA:$IMG_VERSION env: - - name: APP_VERSION - value: "$APP_VERSION" + - name: IMG_VERSION + value: "$IMG_VERSION" - name: OPENSHIFT value: "False" - name: ENVIRONMENT @@ -53,6 +53,11 @@ spec: configMapKeyRef: key: DEBUG name: env-prod + - name: APP_VERSION + valueFrom: + configMapKeyRef: + key: APP_VERSION + name: env-prod - name: DATABASE valueFrom: configMapKeyRef: diff --git a/README.md b/README.md index e789334..c5e7c50 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Crear un proyecto. A continuación añadir una app desde Agregar, importar desde git. - oc new-app http://gitea.reymota.es/creylopez/ReyMotaAppsOC.git -e APP_VERSION="12.0.0" -e DEBUG="False" -e OPENSHIFT="True" --name='reymota' + oc new-app http://gitea.reymota.es/creylopez/ReyMotaAppsOC.git -e APP_VERSION="15.0.0" -e DEBUG="False" -e OPENSHIFT="True" --name='reymota' Tal y como está la estructura de directorios, deberia detectar automáticamente una compilación Python diff --git a/src/reymota/settings.py b/src/reymota/settings.py index 206d0a1..00fe163 100644 --- a/src/reymota/settings.py +++ b/src/reymota/settings.py @@ -14,8 +14,11 @@ from pathlib import Path import os import logging -# APP_VERSION = "11.0.2" + +APP_NAME = "Reymota.es" APP_VERSION = os.environ.get("APP_VERSION", "0.0.0-dev") # Valor por defecto si no está definido +IMG_VERSION = os.environ.get("IMG_VERSION", "0.0.0-dev") # Valor por defecto si no está definido + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent diff --git a/src/reymota/urls.py b/src/reymota/urls.py index de553ca..fc63594 100644 --- a/src/reymota/urls.py +++ b/src/reymota/urls.py @@ -40,4 +40,6 @@ urlpatterns = [ path('usuarios/', include("reymotausers.urls")), + path("acerca-de/", views.acerca_de, name="acerca_de"), + ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/src/reymota/views.py b/src/reymota/views.py index 621798e..9ee0ea5 100644 --- a/src/reymota/views.py +++ b/src/reymota/views.py @@ -29,3 +29,12 @@ def ver_variables_entorno(request): } return render(request, 'ver_entorno.html', contexto) + + +def acerca_de(request): + context = { + "app_name": settings.APP_NAME, + "app_version": settings.APP_VERSION, + "img_version": settings.IMG_VERSION + } + return render(request, "acerca_de.html", context) diff --git a/src/templates/acerca_de.html b/src/templates/acerca_de.html new file mode 100644 index 0000000..f4a8ae3 --- /dev/null +++ b/src/templates/acerca_de.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} + +{% block content %} +