mirror of
https://github.com/foomo/squadron.git
synced 2025-10-16 12:35:42 +00:00
docs: update makefile help
This commit is contained in:
parent
eca9512323
commit
1f5fb6284b
58
Makefile
58
Makefile
@ -12,7 +12,7 @@
|
|||||||
.mise:
|
.mise:
|
||||||
@mise install
|
@mise install
|
||||||
|
|
||||||
## === Tasks ===
|
### Tasks
|
||||||
|
|
||||||
.PHONY: doc
|
.PHONY: doc
|
||||||
## Run tests
|
## Run tests
|
||||||
@ -24,8 +24,8 @@ doc:
|
|||||||
## Run tests
|
## Run tests
|
||||||
test:
|
test:
|
||||||
@# see https://github.com/pterm/pterm/issues/482
|
@# see https://github.com/pterm/pterm/issues/482
|
||||||
@GO_TEST_TAGS=-skip go test -tags=safe -coverprofile=coverage.out -json ./... | gotestfmt
|
@GO_TEST_TAGS=-skip go test -tags=safe -coverprofile=coverage.out
|
||||||
@#GO_TEST_TAGS=-skip go test -tags=safe -coverprofile=coverage.out -race -json ./... | gotestfmt
|
@#GO_TEST_TAGS=-skip go test -tags=safe -coverprofile=coverage.out -race
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
## Run linter
|
## Run linter
|
||||||
@ -60,43 +60,23 @@ build:
|
|||||||
@echo "building bin/squadron"
|
@echo "building bin/squadron"
|
||||||
@go build -tags=safe -o bin/squadron cmd/main.go
|
@go build -tags=safe -o bin/squadron cmd/main.go
|
||||||
|
|
||||||
## === Docker ===
|
### Utils
|
||||||
|
|
||||||
.PHONY: docker
|
|
||||||
## Build docker image
|
|
||||||
docker:
|
|
||||||
@docker buildx build -t foomo/squadron:latest .
|
|
||||||
|
|
||||||
## === Utils ===
|
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
## Show help text
|
## Show help text
|
||||||
help:
|
help:
|
||||||
|
@echo "\033[1;36mSquadron | Compose for Kubernetes\033[0m"
|
||||||
@awk '{ \
|
@awk '{ \
|
||||||
if ($$0 ~ /^.PHONY: [a-zA-Z\-\_0-9]+$$/) { \
|
if($$0 ~ /^### /){ \
|
||||||
helpCommand = substr($$0, index($$0, ":") + 2); \
|
if(help) printf "\033[36m%-23s\033[0m %s\n\n", cmd, help; help=""; \
|
||||||
if (helpMessage) { \
|
printf "\n\033[1;36m%s\033[0m\n", substr($$0,5); \
|
||||||
printf "\033[36m%-23s\033[0m %s\n", \
|
} else if($$0 ~ /^[a-zA-Z0-9._-]+:/){ \
|
||||||
helpCommand, helpMessage; \
|
cmd = substr($$0, 1, index($$0, ":")-1); \
|
||||||
helpMessage = ""; \
|
if(help) printf " \033[36m%-23s\033[0m %s\n", cmd, help; help=""; \
|
||||||
} \
|
} else if($$0 ~ /^##/){ \
|
||||||
} else if ($$0 ~ /^[a-zA-Z\-\_0-9.]+:/) { \
|
help = help ? help "\n " substr($$0,3) : substr($$0,3); \
|
||||||
helpCommand = substr($$0, 0, index($$0, ":")); \
|
} else if(help){ \
|
||||||
if (helpMessage) { \
|
print "\n " help "\n"; help=""; \
|
||||||
printf "\033[36m%-23s\033[0m %s\n", \
|
} \
|
||||||
helpCommand, helpMessage"\n"; \
|
}' $(MAKEFILE_LIST)
|
||||||
helpMessage = ""; \
|
|
||||||
} \
|
|
||||||
} else if ($$0 ~ /^##/) { \
|
|
||||||
if (helpMessage) { \
|
|
||||||
helpMessage = helpMessage"\n "substr($$0, 3); \
|
|
||||||
} else { \
|
|
||||||
helpMessage = substr($$0, 3); \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
if (helpMessage) { \
|
|
||||||
print "\n "helpMessage"\n" \
|
|
||||||
} \
|
|
||||||
helpMessage = ""; \
|
|
||||||
} \
|
|
||||||
}' \
|
|
||||||
$(MAKEFILE_LIST)
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user