-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update makefile to run only on file changes
- Loading branch information
1 parent
172df24
commit 2d64cb1
Showing
2 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.test_sessions | ||
test/.ran-build-docker | ||
test/.ran-docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
.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: docker | ||
@docker run -h harpoon-test --name harpoon-test harpoon-test | ||
test: | test/.ran-build-docker | ||
@docker run -h $(IMAGE_NAME) --name $(IMAGE_NAME) $(IMAGE_NAME) | ||
@docker rm $(IMAGE_NAME) | ||
|
||
docker: test/Dockerfile harpoon test/driver.sh --clean | ||
@docker build -t harpoon-test -f test/Dockerfile . | ||
test/.ran-build-docker: test/Dockerfile harpoon test/driver.sh | ||
@$(MAKE) -- --clean >/dev/null | ||
@docker build -t $(IMAGE_NAME) -f test/Dockerfile . | ||
@touch $@ | ||
|
||
--clean: | ||
@docker ps -a --format '{{.Image}}' | grep -w "harpoon-test" \ | ||
@docker ps -a --format '{{.Image}}' | grep -w "$(IMAGE_NAME)" \ | ||
| xargs -I {} docker rm {} >/dev/null 2>&1 || :; | ||
@docker images -a --format '{{.Repository}}' | grep -w "harpoon-test" \ | ||
@docker images -a --format '{{.Repository}}' | grep -w "$(IMAGE_NAME)" \ | ||
| xargs -I {} docker rmi {} >/dev/null 2>&1 || :; | ||
|