.DEFAULT_GOAL := all

build: clean
	bee pack

run:
	bee run -gendoc=true -downdoc=true

purge:
	lsof -t -i:8091 | xargs kill | true

run-dev:
	bee generate routers && bee run -gendoc=true -downdoc=true -runmode=prod

dev: purge run-dev

debug:
	bee run -downdebug -gendebug

clean:
	rm -rf oc-shared.tar.gz

docker:
	DOCKER_BUILDKIT=1 docker build -t oc-shared -f Dockerfile . --build-arg=HOST=$(HOST)
	docker tag oc-shared opencloudregistry/oc-shared:latest

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

publish-registry:
	docker push opencloudregistry/oc-shared:latest

all: docker publish-kind publish-registry

ci: docker publish-registry

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