Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
- Use git submodule for tools.
- Update Makefile to use submodules.
- Put submodule at tools/
- Tidy up some obsolete references to tools in .gitignore.
  • Loading branch information
Tom Wilkie committed Sep 30, 2015
1 parent 8130230 commit 5fba29f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -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
Expand All @@ -62,4 +60,3 @@ Vagrantfile.local
test/tls/*.pem
test/coverage
test/coverage.*
.tools
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "tools"]
path = tools
url = https://github.com/weaveworks/tools
18 changes: 8 additions & 10 deletions 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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tools
Submodule tools added at caecc9

0 comments on commit 5fba29f

Please sign in to comment.