2023-03-11 01:55:59 -05:00
|
|
|
.PHONY: deps dev build image clean
|
2021-12-08 21:47:48 -05:00
|
|
|
|
|
|
|
GOCMD=go
|
2023-03-11 01:55:59 -05:00
|
|
|
IMAGE := r.mills.io/prologic/zs
|
|
|
|
TAG := latest
|
2021-12-08 21:47:48 -05:00
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
deps:
|
|
|
|
@$(GOCMD) install git.mills.io/prologic/zs@latest
|
|
|
|
@$(GOCMD) install git.mills.io/prologic/static@latest
|
|
|
|
|
|
|
|
dev : DEBUG=1
|
|
|
|
dev : build
|
2023-03-11 01:55:59 -05:00
|
|
|
@bash -c 'trap "jobs -p | xargs kill" EXIT; \
|
|
|
|
zs watch & \
|
|
|
|
static -r .pub & \
|
|
|
|
echo http://localhost:8000/; \
|
|
|
|
wait'
|
2021-12-08 21:47:48 -05:00
|
|
|
|
|
|
|
build:
|
|
|
|
@zs build
|
|
|
|
|
|
|
|
ifeq ($(PUBLISH), 1)
|
|
|
|
image:
|
2023-03-11 01:55:59 -05:00
|
|
|
@docker buildx build --platform linux/amd64,linux/arm64 --push -t $(IMAGE):$(TAG) .
|
2021-12-08 21:47:48 -05:00
|
|
|
else
|
|
|
|
image:
|
2023-03-11 01:55:59 -05:00
|
|
|
@docker build -t $(IMAGE):$(TAG) .
|
2021-12-08 21:47:48 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@git clean -f -d -X
|