[make] Add Makefile
This commit is contained in:
parent
388c89d96d
commit
761aa20d49
1 changed files with 25 additions and 0 deletions
25
Makefile
Normal file
25
Makefile
Normal file
|
@ -0,0 +1,25 @@
|
|||
.PHONY: default run fmt help
|
||||
|
||||
default: help
|
||||
|
||||
run: ## Run the program
|
||||
go run server.go
|
||||
|
||||
build: Dockerfile ## Build container image
|
||||
@docker build . -t aeolyus/gull
|
||||
|
||||
release: Dockerfile ## Build and push the container image for all platforms
|
||||
@docker buildx build . \
|
||||
-t aeolyus/gull \
|
||||
-t ghcr.io/aeolyus/gull \
|
||||
--platform linux/arm,linux/arm64,linux/amd64 \
|
||||
--push
|
||||
|
||||
fmt: ## Format the code
|
||||
go fmt ./...
|
||||
|
||||
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}'
|
Loading…
Reference in a new issue