REGISTRY ?= registry.haumdaucher.de
IMAGE_NAME ?= sasch40
TAG ?= latest
PLATFORM ?= linux/amd64

IMAGE ?= $(REGISTRY)/$(IMAGE_NAME):$(TAG)

.PHONY: build tag push all dev compile deploy

all: compile build tag push deploy

dev:
	npm run dev

compile:
	npm run build

build:
	docker build --platform $(PLATFORM) -t $(IMAGE_NAME):$(TAG) .

tag:
	docker tag $(IMAGE_NAME):$(TAG) $(IMAGE)

push:
	docker push $(IMAGE)

deploy:
	kubectl rollout restart deployment/sasch40 -n web
	kubectl rollout status deployment/sasch40 -n web
