PROJECT_NAME := $(shell basename $(shell pwd)) GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g') IMAGE_TAG := $(PROJECT_NAME):$(GIT_BRANCH) .PHONY: clean setup build test run sparkled: @go build -o sparkled ./cmd/sparkled/main.go clean: @rm -f sparkled setup: @mise install @go install tool @command -v godotenv @command -v yamlfmt build: sparkled test-unit: @go clean -testcache @go test -shuffle=on ./... test-integration: build-image @IMAGE_TAG=$(IMAGE_TAG) go test -tags=integration ./test/integration/... test: test-unit test-integration build-image: @docker build --tag $(IMAGE_TAG) . build-builder-image: @docker build --target build --tag $(IMAGE_TAG) . run: clean build @godotenv -f .env.local,.env ./sparkled run-image: build-image @docker run --rm --env-file .env -p 10000:10000 -p 9901:9901 -p 8080:8080 -it $(IMAGE_TAG); \ sh-image: build-builder-image @docker run --rm -it $(IMAGE_TAG) /bin/sh lint: @yamlfmt --lint . tidy: @go get -u ./... @go mod tidy @yamlfmt .