# Создано: 2026-04-12
# Makefile для IoT managed service.

IMG ?= naeel/iot-operator:latest

.PHONY: build build-all docker-build docker-push test tidy

# Собрать все бинарники
build-all: build-operator build-bridge build-consumer

build-operator:
CGO_ENABLED=0 go build -o bin/iot-operator ./cmd/iot-operator/

build-bridge:
CGO_ENABLED=0 go build -o bin/mqtt-bridge ./cmd/mqtt-bridge/

build-consumer:
	CGO_ENABLED=0 go build -o bin/sqs-consumer ./cmd/sqs-consumer/
test:
go test ./...

tidy:
go mod tidy

# Применить CRD в кластер
install-crd:
kubectl apply -f config/crd/bases/

# Деплой всех компонентов
deploy:
kubectl apply -f deployments/k8s/
