-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmakefile
More file actions
32 lines (25 loc) · 990 Bytes
/
Copy pathmakefile
File metadata and controls
32 lines (25 loc) · 990 Bytes
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
29
30
31
32
.PHONY: test
INSTALL_PATH?=/usr/bin/harpoon
IMAGE_NAME=harpoon-test
install: ./harpoon
@install -m 0555 -C ./harpoon $(INSTALL_PATH)
uninstall:
@rm $(INSTALL_PATH)
test: | test/.ran-build-docker
@docker run -h $(IMAGE_NAME) --name $(IMAGE_NAME) $(IMAGE_NAME)
@docker rm $(IMAGE_NAME) >/dev/null
test/.ran-build-docker: test/Dockerfile harpoon test/driver.sh
@$(MAKE) -- --clean >/dev/null
@docker build -t $(IMAGE_NAME) -f test/Dockerfile .
@touch $@
help:
@echo "📦 Available make targets:"
@echo " make install Install harpoon to $(INSTALL_PATH)"
@echo " make uninstall Remove harpoon from $(INSTALL_PATH)"
@echo " make test Run tests inside Docker"
@echo " make help Show this help message"
--clean:
@docker ps -a --format '{{.Image}}' | grep -w "$(IMAGE_NAME)" \
| xargs -I {} docker rm {} >/dev/null 2>&1 || :;
@docker images -a --format '{{.Repository}}' | grep -w "$(IMAGE_NAME)" \
| xargs -I {} docker rmi {} >/dev/null 2>&1 || :;