Kaynağa Gözat

Pongo cuentas por defecto en Agregar Movimiento

Celestino Rey 4 ay önce
ebeveyn
işleme
82052cebd8
4 değiştirilmiş dosya ile 21 ekleme ve 6 silme
  1. 1 0
      K8S/.current_version
  2. 1 0
      K8S/.version
  3. 17 5
      K8S/Makefile
  4. 2 1
      src/templates/base.html

+ 1 - 0
K8S/.current_version

@@ -0,0 +1 @@
+alpine-4

+ 1 - 0
K8S/.version

@@ -0,0 +1 @@
+alpine-5

+ 17 - 5
K8S/Makefile

@@ -1,13 +1,25 @@
 export REGISTRO=harbor.reymota.es\/reymota
 #export REGISTRO=registry.reymota.es
-export IMG_VERSION = 48.8
 export NAMESPACE = finanzas
+VERSION_FILE = .version
+
+# Get current version or default to alpine-1
+IMG_VERSION := $(shell cat $(VERSION_FILE) 2>/dev/null || echo "alpine-1")
+# Get built version for deployment targets
+BUILT_VERSION := $(shell cat .current_version 2>/dev/null || echo "$(IMG_VERSION)")
+export IMG_VERSION
 
 # limpia todo
 all: imagen clean install
 
 imagen:
+	@echo "Building image with version: $(IMG_VERSION)"
+	@# Store current version for other targets to use
+	@echo "$(IMG_VERSION)" > .current_version
 	cd ../; make
+	@# Increment version for next build
+	@echo "$(IMG_VERSION)" | sed 's/alpine-\([0-9]*\)/alpine-\1/' | awk -F'-' '{print "alpine-" $$2+1}' > $(VERSION_FILE)
+	@echo "Next version will be: $$(cat $(VERSION_FILE))"
 
 ns:
 	-cat namespace.yaml | sed -e "s/<NS>/${NAMESPACE}/" |kubectl create -f -
@@ -17,7 +29,7 @@ install:
 	-cat env-prod-configmap.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 	-cat secreto-db.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl create -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${BUILT_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl create -f -
 	-cat finanzas-service.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 	-cat finanzas-ingress.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
@@ -25,7 +37,7 @@ clean:
 
 	-cat finanzas-ingress.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
 
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${BUILT_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
 
 	-cat finanzas-service.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
 
@@ -42,8 +54,8 @@ claims:
 	-cat pvc-static.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
 app:
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl create -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${BUILT_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${BUILT_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl create -f -
 
 db:
 	-kubectl create -f finanzas-db.yaml

+ 2 - 1
src/templates/base.html

@@ -126,7 +126,8 @@
 
                      <li class="nav-item">
                         <!--//Bootstrap Icons: https://icons.getbootstrap.com/ -->
-                        <a class="nav-link" href="{% url 'agregar_movimiento' %}">
+
+                        <a class="nav-link" href="{% url 'agregar_movimiento' %}?origen=Efectivo&destino=Alcampo">
                             <span class="nav-icon">
                             <!--//Bootstrap Icons: https://icons.getbootstrap.com/ -->
                             <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-files" fill="currentColor" xmlns="http://www.w3.org/2000/svg">