@cryptotaxi247 / kubo / commits / 87c4fb2fe

Makefiles: build the test docker img

this commit changes how the dockertest image is built. it moves the command into dockertest/Makefile. It also uses a cached file that -- if removed with make clean -- can signal whether the image should be rebuilt. (it may be ideal to have it either detect code has changed, or just rebuild every time. )

Juan Batiz-Benet committed Dec 22, 2014 at 23:48 UTC 87c4fb2fea8a0ee7577e2ba1bd336160407dcd86
3 files changed +12 -6
Makefile
-1
@@ -18,7 +18,6 @@ test: test_go test_sharness
18 test_expensive: test_go_expensive test_sharness_expensive
19
20 test_docker:
21 - docker build -t zaqwsx_ipfs-test-img .
21 cd dockertest/ && make
22
23 test_go:
dockertest/Makefile
+11 -3
@@ -14,9 +14,6 @@ setup: docker_ipfs_image data/filetiny data/filerand
14 save_logs:
15 sh bin/save_logs.sh
16
17 -docker_ipfs_image:
18 - docker images | grep $(IPFS_DOCKER_IMAGE)
19 -
17 data/filetiny: Makefile
18 cp Makefile ./data/filetiny # simple
19
@@ -26,6 +23,16 @@ data/filerand: bin/random
23 bin/random:
24 go build -o ./bin/random ../$(RANDOMSRC)
25
26 +docker_ipfs_image: build/.built_img
27 + docker images | grep $(IPFS_DOCKER_IMAGE)
28 +
29 +# this is here so that "make clean; make" rebuilds the docker img.
30 +# but otherwise will reuse whatever you last built.
31 +# TODO: make this detect whether code has been changed
32 +build/.built_img:
33 + cd .. && docker build -t $(IPFS_DOCKER_IMAGE) .
34 + touch build/.built_img
35 +
36 clean:
37 sh bin/clean.sh
38 fig stop
@@ -34,3 +41,4 @@ clean:
41 rm -f data/filetiny
42 rm -f data/filerand
43 rm -rf build/*
44 + rm -rf build/.built_img
dockertest/build/.gitignore
+1 -2
@@ -1,2 +1 @@
1 -*.log
2 -go-random
1 +.built_img