.DEFAULT_GOAL := all

build: clean
	go build .

build-monitord:
	go build -o ../oc-monitord ../oc-monitord

run:
	./oc-schedulerd

clean:
	rm -rf  oc-schedulerd

docker:
	DOCKER_BUILDKIT=1 docker build -t oc/oc-schedulerd:0.0.1 --build-arg MONITORD_IMAGE=oc/oc-monitord -f Dockerfile . 
	docker tag oc/oc-schedulerd:0.0.1 oc/oc-schedulerd:latest

publish-kind:
	kind load docker-image oc/oc-schedulerd:0.0.1 --name opencloud

publish-registry:
	@echo "TODO"

all: docker publish-kind publish-registry

dev: build-monitord build run

.PHONY: build run clean docker publish-kind publish-registry