gull/Makefile

33 lines
803 B
Makefile
Raw Normal View History

2022-01-10 02:31:12 +01:00
.PHONY: default run fmt help
default: help
run: ## Run the program
go run server.go
2023-04-27 06:12:24 +02:00
image: Dockerfile ## Build container image
@docker buildx build . -t ghcr.io/aeolyus/gull
2022-01-10 02:31:12 +01:00
release: Dockerfile ## Build and push the container image for all platforms
2023-04-27 06:12:24 +02:00
-@docker buildx rm gull-builder
@docker buildx create --name gull-builder --bootstrap --use
2022-01-10 02:31:12 +01:00
@docker buildx build . \
-t aeolyus/gull \
-t ghcr.io/aeolyus/gull \
--platform linux/arm,linux/arm64,linux/amd64 \
--push
2023-04-27 06:12:24 +02:00
@docker buildx stop
-@docker buildx rm gull-builder
2022-01-10 02:31:12 +01:00
fmt: ## Format the code
go fmt ./...
2022-01-11 07:42:18 +01:00
test: ## Run tests
go test -cover ./...
2022-01-10 02:31:12 +01:00
help: Makefile ## Print this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; \
{printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'