Files
Celes Renata 5be3ce2db9 feat: migrate CI/CD from GHCR to local Harbor registry
- Makefile: GHCR -> registry.celestium.life/stonks-oracle
- GitHub Actions: login to Harbor, use HARBOR_PASSWORD secret
- infra/k8s/*.yaml: all image refs -> registry.celestium.life
- inttest pipeline: remove GHCR pull secret (local registry, no auth)
- Steering docs: update registry/git endpoints
2026-04-19 07:34:28 +00:00

75 lines
2.6 KiB
Makefile

REPO_OWNER := celesrenata
REPO_NAME := stonks-oracle
REGISTRY := registry.celestium.life/stonks-oracle
SHA := $(shell git rev-parse --short HEAD 2>/dev/null || echo "dev")
SERVICES := scheduler symbol-registry ingestion parser extractor aggregation recommendation risk broker-adapter lake-publisher query-api
.PHONY: help lint test build push deploy clean
help:
@echo "Targets:"
@echo " lint - Run ruff linter"
@echo " test - Run pytest"
@echo " build - Build all service images locally"
@echo " push - Push all images to registry"
@echo " deploy - Apply K8s manifests"
@echo " clean - Remove local images"
lint:
ruff check services/
test:
pytest tests/ -x --tb=short -q
build:
@for svc in $(SERVICES); do \
case $$svc in \
scheduler) cmd="python -m services.scheduler.app" ;; \
symbol-registry) cmd="uvicorn services.symbol_registry.app:app --host 0.0.0.0 --port 8000" ;; \
ingestion) cmd="python -m services.ingestion.worker" ;; \
parser) cmd="python -m services.parser.worker" ;; \
extractor) cmd="python -m services.extractor.main" ;; \
aggregation) cmd="python -m services.aggregation.main" ;; \
recommendation) cmd="python -m services.recommendation.main" ;; \
risk) cmd="uvicorn services.risk.app:app --host 0.0.0.0 --port 8000" ;; \
broker-adapter) cmd="python -m services.adapters.broker_service" ;; \
lake-publisher) cmd="python -m services.lake_publisher.jobs" ;; \
query-api) cmd="uvicorn services.api.app:app --host 0.0.0.0 --port 8000" ;; \
esac; \
echo "Building $$svc ($$cmd)..."; \
docker build \
--build-arg "SERVICE_CMD=$$cmd" \
-t $(REGISTRY)/$$svc:$(SHA) \
-t $(REGISTRY)/$$svc:latest \
-f docker/Dockerfile . || exit 1; \
done
@echo "Building dashboard..."
docker build \
-t $(REGISTRY)/dashboard:$(SHA) \
-t $(REGISTRY)/dashboard:latest \
-f frontend/Dockerfile frontend/ || exit 1
@echo "Building superset..."
docker build \
-t $(REGISTRY)/superset:$(SHA) \
-t $(REGISTRY)/superset:latest \
-f docker/Dockerfile.superset docker/ || exit 1
push:
@for svc in $(SERVICES); do \
echo "Pushing $$svc..."; \
docker push $(REGISTRY)/$$svc:$(SHA); \
docker push $(REGISTRY)/$$svc:latest; \
done
deploy:
kubectl apply -f infra/k8s/namespace.yaml
kubectl apply -f infra/k8s/configmap.yaml
kubectl apply -f infra/k8s/secrets.yaml
kubectl apply -f infra/k8s/
clean:
@for svc in $(SERVICES); do \
docker rmi $(REGISTRY)/$$svc:$(SHA) $(REGISTRY)/$$svc:latest 2>/dev/null || true; \
done