Skip to content

Commit 88ed475

Browse files
authored
Merge pull request #16 from rdohms/enhancement/makefile-help
Add help to Makefile
2 parents ab71fb1 + 7987175 commit 88ed475

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
qa: lint test
1+
qa: lint test ## Lint and test the code in multiple images
22

33
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
44
current_dir := $(abspath $(patsubst %/,%,$(dir $(mkfile_path))))
55

66
.PHONY: *
77

8-
lint: php-fpm-healthcheck
8+
lint: php-fpm-healthcheck ## Lint code
99
docker run --rm -v ${current_dir}:/mnt:ro koalaman/shellcheck \
1010
./php-fpm-healthcheck ./test/*.sh
1111

12-
test:
12+
test: ## Test code in multiple images
1313
$(MAKE) test-image IMAGE="php:fpm-alpine" DOCKERFILE="alpine"
1414
$(MAKE) test-image IMAGE="php:7.1-fpm-alpine3.7" DOCKERFILE="alpine"
1515
$(MAKE) test-image IMAGE="php:7.1-fpm-alpine3.8" DOCKERFILE="alpine"
@@ -22,3 +22,7 @@ test:
2222

2323
test-image:
2424
./test/docker.sh ${DOCKERFILE} ${IMAGE}
25+
26+
help:
27+
@echo "\033[33mUsage:\033[0m\n make [target] [FLAGS=\"val\"...]\n\n\033[33mTargets:\033[0m"
28+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}' #look at this magic

0 commit comments

Comments
 (0)