From 1c2c71cfc44405881722d00b107a1eb13bceed9f Mon Sep 17 00:00:00 2001 From: Luciano Giacchetta Date: Fri, 13 Jun 2025 15:56:45 -0300 Subject: [PATCH] Fix #6 - Agregar despliege workflow y makefile (#7) Reviewed-on: https://gianet.us/codyops/apex/pulls/7 Co-authored-by: Luciano Giacchetta Co-committed-by: Luciano Giacchetta --- .gitea/workflows/builder.yaml | 2 ++ Makefile | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/builder.yaml b/.gitea/workflows/builder.yaml index f14acdd..e375594 100644 --- a/.gitea/workflows/builder.yaml +++ b/.gitea/workflows/builder.yaml @@ -17,4 +17,6 @@ jobs: uses: actions/checkout@v4 - name: Make Build run: make build + - name: Make Deploy + run: make deploy \ No newline at end of file diff --git a/Makefile b/Makefile index 1a548df..0196960 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -REGISTRY:= gianet.us/codyops +NAMESPACE:= codyops +REGISTRY:= gianet.us/$(NAMESPACE) IMAGE:= apex DOMAINS:= com es br -.PHONY: init build setup $(addprefix step-,$(DOMAINS)) +.PHONY: init build setup $(addprefix step-,$(DOMAINS)) $(addprefix deploy-,$(DOMAINS)) init: direnv allow . @@ -17,4 +18,9 @@ $(addprefix step-,$(DOMAINS)): export ASTRO_GTAG=${ASTRO_GTAG_$(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-%,%,$@) + podman push $(REGISTRY)/$(IMAGE):$(patsubst step-%,%,$@) + +deploy: $(addprefix deploy-,$(DOMAINS)) + +$(addprefix deploy-,$(DOMAINS)): + kubectl -n $(NAMESPACE) rollout restart deployment/$(NAMESPACE)-$(IMAGE)-$(shell echo $(patsubst deploy-%,%,$@)) \ No newline at end of file