forked from getnf/getnf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 1.19 KB
/
Makefile
File metadata and controls
28 lines (20 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
SHELL := /bin/bash
all:
@echo 'Type `make help` to see the help menu.'
help: ## Prints this help menu
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
container: ## Build a docker container for testing
@if ! command -v docker > /dev/null; then echo "Docker not found, install it first"; \
elif [[ $$(docker images | grep getnftest) ]]; then \
echo 'Container "getnftest" already exists'; else echo 'Building the "getnftest" container' \
&& docker build -t getnftest . && echo "Built successfully"; fi
delcontainer: ## Delete the docker container for testing
@if [[ $$(docker images | grep getnftest) ]]; then echo 'Deleting "getnftest" container' && \
docker image rm getnftest:latest -f; \
else echo 'Container "getnftest" not found. Build it with `make container`.'; fi
rebuild: delcontainer container ## Rebuild existing docker container
test: ## Run the getnftest container interactively
@if [[ $$(docker images | grep getnftest) ]]; then docker run -it getnftest; \
else echo 'Container "getnftest" not found. Build it with `make container`.'; fi
.PHONY: all help container delcontainer rebuild test