Skip to content

Commit 3a784f7

Browse files
committed
Add a helper Makefle
1 parent 71bef4a commit 3a784f7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Container image
2+
IMAGE_REPO ?= phpcfdi/cfditopdf
3+
IMAGE_TAG ?= latest
4+
5+
.DEFAULT_GOAL := help
6+
.PHONY: build run help
7+
8+
build: ## Build the container image
9+
docker build -t $(IMAGE_REPO):$(IMAGE_TAG) .
10+
11+
run: ## Run container passing `cmd` make argument as the containr command
12+
@docker run --rm \
13+
--volume $(shell pwd)/files:/app/files \
14+
--user $(shell id -u ${USER}):$(shell id -g ${USER}) \
15+
$(IMAGE_REPO):$(IMAGE_TAG) \
16+
$(cmd)
17+
18+
help: ## Print this help.
19+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

0 commit comments

Comments
 (0)