-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
19 lines (15 loc) · 907 Bytes
/
Makefile
File metadata and controls
19 lines (15 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.DEFAULT_GOAL := help
.PHONY: help
help: ## Prints this help text
@echo "Usage: make \033[32m<command>\033[0m\n"
@echo "the following commands are available:\n"
@grep -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
.PHONY: build
build: ## Build the docker image
@docker build --no-cache -t fakturownia-php:latest .
.PHONY: sh
sh: ## Start an interactive shell in the docker container
@docker run -it --rm --name fakturownia-php -v "$$PWD:/app" -w /app -u "$$(id -u):$$(id -g)" --add-host=host.docker.internal:host-gateway fakturownia-php:latest bash
.PHONY: run
run: ## Run a command in the docker container, e.g. make run cmd="composer tests"
@docker run --rm -v "$$PWD:/app" -w /app -u "$$(id -u):$$(id -g)" --add-host=host.docker.internal:host-gateway fakturownia-php:latest $(cmd)