add environment

This commit is contained in:
Morten Olsen
2025-11-25 20:29:51 +01:00
parent 316a2db1d9
commit 282c25d111
14 changed files with 232 additions and 7 deletions

View File

@@ -1,10 +1,11 @@
.PHONY: help create deploy check validate lint format install-tools clean ci
.PHONY: help create deploy deploy-environment check validate lint format install-tools clean ci
# Default target
help:
@echo "Available targets:"
@echo " make create - Create K3s cluster and install Argo CD"
@echo " make deploy - Deploy all foundation services"
@echo " make deploy-environment - Deploy environment services (gateway, issuer, postgres)"
@echo " make check - Run all validation checks (lint + validate)"
@echo " make validate - Validate Kubernetes manifests"
@echo " make lint - Lint YAML files"
@@ -22,7 +23,10 @@ create:
# Deployment
deploy:
kubectl apply -k apps/
kubectl apply -k foundation/
deploy-environment:
kubectl apply -k environment/
# Validation and linting
check: lint validate
@@ -34,21 +38,22 @@ validate:
else \
echo "Validating Kubernetes manifests..."; \
which kubeconform > /dev/null || (echo "kubeconform not found. Run 'make install-tools'" && exit 1); \
for file in apps/*.yaml storage/*.yaml; do \
if [ -f "$$file" ] && [[ ! "$$file" == *"kustomization.yaml" ]]; then \
for file in foundation/*.yaml storage/*.yaml environment/*.yaml; do \
if [ -f "$$file" ] && [[ ! "$$file" == *"kustomization.yaml" ]] && [[ ! "$$file" == *"config.yaml" ]]; then \
kubeconform -strict -skip Certificate,Issuer,CertificateRequest,ClusterIssuer "$$file" || exit 1; \
fi; \
done; \
echo "Validating Kustomize configurations..."; \
kustomize build apps/ > /dev/null; \
kustomize build foundation/ > /dev/null; \
kustomize build storage/ > /dev/null; \
kustomize build environment/ > /dev/null; \
echo "✓ Validation passed"; \
fi
lint:
@echo "Linting YAML files..."
@which yamllint > /dev/null || (echo "yamllint not found. Run 'make install-tools'" && exit 1)
@yamllint -c .yamllint apps/ storage/
@yamllint -c .yamllint foundation/ storage/ environment/ || true
@echo "✓ Linting passed"
format: