core/Makefile
Luciano Giacchetta e5642145a7
All checks were successful
CodyOps Core Builder / build-conteiner (push) Successful in 2m56s
Agregar despliegue automatico en CI y en schedule (#3)
Reviewed-on: #3
Co-authored-by: Luciano Giacchetta <giacchetta-@outlook.com>
Co-committed-by: Luciano Giacchetta <giacchetta-@outlook.com>
2025-08-01 17:56:27 -03:00

30 lines
1.2 KiB
Makefile

NAMESPACE:= codyops
REGISTRY:= gianet.us/$(NAMESPACE)
IMAGE:= core
COUNTRIES:= ar br cl co cr do ec es mx pa pe pr py sv us uy
.PHONY: init build setup $(addprefix step-,$(COUNTRIES)) $(addprefix deploy-,$(DOMAINS))
init:
direnv allow .
setup:
npm install
build: setup $(addprefix step-,$(COUNTRIES))
$(addprefix step-,$(COUNTRIES)):
@echo "Ejecutando step para el país: $(shell echo $(patsubst step-%,%,$@) | tr '[:lower:]' '[:upper:]')"
export ASTRO_COUNTRY=$(shell echo $(patsubst step-%,%,$@) | tr '[:lower:]' '[:upper:]') && \
export ASTRO_CURRENCY=${ASTRO_CURRENCY_$(shell echo $(patsubst step-%,%,$@) | tr '[:lower:]' '[:upper:]')} && \
export ASTRO_SITE=${ASTRO_SITE_$(shell echo $(patsubst step-%,%,$@) | tr '[:lower:]' '[:upper:]')} && \
export ASTRO_GTM=${ASTRO_GTM_$(shell echo $(patsubst step-%,%,$@) | tr '[:lower:]' '[:upper:]')} && \
npx astro build --force
podman build --pull=newer --tag $(REGISTRY)/$(IMAGE):$(patsubst step-%,%,$@) .
podman push $(REGISTRY)/$(IMAGE):$(patsubst step-%,%,$@)
deploy: $(addprefix deploy-,$(COUNTRIES))
$(addprefix deploy-,$(COUNTRIES)):
kubectl -n $(NAMESPACE) rollout restart deployment/$(NAMESPACE)-$(IMAGE)-$(shell echo $(patsubst deploy-%,%,$@))