| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- export REGISTRO=harbor.reymota.es\/reymota
- #export REGISTRO=registry.reymota.es
- 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 -
- install:
- -cat reg-secret.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
- -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>/${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 -
- 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>/${BUILT_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
- -cat finanzas-service.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
- -cat secreto-db.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
- -cat env-prod-configmap.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
- -cat reg-secret.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
- borraclaims:
- -cat pvc-finanzas.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
- -cat pvc-static.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
- claims:
- -cat pvc-finanzas.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
- -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>/${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
|