From 5208dcd67ea62f45e64141155b5c2f90e590e39f Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 28 Sep 2015 08:07:51 +0000 Subject: [PATCH] Review feedback - Use git submodule for tools. - Update Makefile to use submodules. - Put submodule at tools/ - Tidy up some obsolete references to tools in .gitignore. --- .gitignore | 3 --- .gitmodules | 3 +++ Makefile | 18 ++++++++---------- tools | 1 + 4 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 .gitmodules create mode 160000 tools diff --git a/.gitignore b/.gitignore index 143b10a6..a47a726b 100644 --- a/.gitignore +++ b/.gitignore @@ -43,8 +43,6 @@ prog/netcheck/netcheck prog/docker_tls_args/docker_tls_args testing/cover/cover testing/runner/runner -tools/bin -tools/build releases .weaver.uptodate .weavedns.uptodate @@ -62,4 +60,3 @@ Vagrantfile.local test/tls/*.pem test/coverage test/coverage.* -.tools diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..46256a7e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tools"] + path = tools + url = https://github.com/weaveworks/tools diff --git a/Makefile b/Makefile index 624d29d9..02ab27c5 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PUBLISH=publish_weave publish_weaveexec .DEFAULT: all -.PHONY: all update tests publish $(PUBLISH) clean clean-bin prerequisites build travis run-smoketests +.PHONY: all update tests lint publish $(PUBLISH) clean clean-bin prerequisites build travis run-smoketests # If you can use docker without being root, you can do "make SUDO=" SUDO=sudo @@ -44,9 +44,6 @@ NETGO_CHECK=@strings $@ | grep cgo_stub\\\.go >/dev/null || { \ echo " sudo go install -tags netgo std"; \ false; \ } -ENSURE_TOOLS=@if [ ! -d .tools ]; then \ - git clone https://github.com/weaveworks/tools.git .tools/;\ -fi BUILD_FLAGS=-ldflags "-extldflags \"-static\" -X main.version $(WEAVE_VERSION)" -tags netgo all: $(WEAVE_EXPORT) $(COVER_EXE) $(RUNNER_EXE) @@ -111,13 +108,14 @@ $(WEAVE_EXPORT): $(IMAGES_UPTODATE) $(DOCKER_DISTRIB): curl -o $(DOCKER_DISTRIB) $(DOCKER_DISTRIB_URL) -tests: $(COVER_EXE) - $(ENSURE_TOOLS) - .tools/test +tests: $(COVER_EXE) tools/.git + tools/test -lint: - $(ENSURE_TOOLS) - .tools/lint -nocomment -notestpackage . +lint: tools/.git + tools/lint -nocomment -notestpackage . + +tools/.git: + git submodule update --init $(PUBLISH): publish_%: $(IMAGES_UPTODATE) $(SUDO) docker tag -f $(DOCKERHUB_USER)/$* $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION) diff --git a/tools b/tools new file mode 160000 index 00000000..caecc98f --- /dev/null +++ b/tools @@ -0,0 +1 @@ +Subproject commit caecc98fa89c7115dd78b20912842ee592d7439d