From bcd346ab5b6cff63b6d7355f12812812beee7e15 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 2 Nov 2015 16:38:07 +0000 Subject: [PATCH 1/2] Release script should use make tests to run tests. --- Makefile | 3 +-- bin/release | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 03f186ac9..b3e91cea7 100644 --- a/Makefile +++ b/Makefile @@ -106,8 +106,7 @@ clean: ifeq ($(BUILD_IN_CONTAINER),true) tests: $(SUDO) docker run $(RM) -v $(shell pwd):/go/src/github.com/weaveworks/scope \ - -e GOARCH -e GOOS -e CIRCLECI --entrypoint=/bin/sh $(SCOPE_BACKEND_BUILD_IMAGE) -c \ - "cd /go/src/github.com/weaveworks/scope && ./tools/test -no-go-get" + -e GOARCH -e GOOS -e CIRCLECI $(SCOPE_BACKEND_BUILD_IMAGE) tests else tests: ./tools/test -no-go-get diff --git a/bin/release b/bin/release index 838ea8ccc..053498f2f 100755 --- a/bin/release +++ b/bin/release @@ -91,7 +91,7 @@ build() { sed -i "/SCRIPT_VERSION=/ c\SCRIPT_VERSION=\"$VERSION\"" ./scope make SUDO=$SUDO SCOPE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER - if $(go list -e -f {{.Dir}} github.com/weaveworks/tools)/test; then + if make tests; then echo -e '\u2713 Tests pass' else echo -e "\u2757 Tests failed, probably best not publish this one" >&2 From 43f6cf711457d5533c416d2180b6be4f3bfae188 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Tue, 3 Nov 2015 14:11:36 +0000 Subject: [PATCH 2/2] Fix build warning with go1.5 --- Makefile | 4 ++-- backend/build.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b3e91cea7..a08fb5ec1 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ $(APP_EXE) $(PROBE_EXE) $(RUNSVINIT): $(SCOPE_BACKEND_BUILD_UPTODATE) $(SUDO) docker run $(RM) -v $(shell pwd):/go/src/github.com/weaveworks/scope -e GOARCH -e GOOS \ $(SCOPE_BACKEND_BUILD_IMAGE) SCOPE_VERSION=$(SCOPE_VERSION) $@ else -$(APP_EXE) $(PROBE_EXE): - go build -ldflags "-extldflags \"-static\" -X main.version $(SCOPE_VERSION)" -tags netgo -o $@ ./$(@D) +$(APP_EXE) $(PROBE_EXE): $(SCOPE_BACKEND_BUILD_UPTODATE) + go build -ldflags "-extldflags \"-static\" -X main.version=$(SCOPE_VERSION)" -tags netgo -o $@ ./$(@D) @strings $@ | grep cgo_stub\\\.go >/dev/null || { \ rm $@; \ echo "\nYour go standard library was built without the 'netgo' build tag."; \ diff --git a/backend/build.sh b/backend/build.sh index 81448d550..e1402a18a 100755 --- a/backend/build.sh +++ b/backend/build.sh @@ -6,6 +6,5 @@ set -eux # -v $(pwd):/go/src/github.com/weaveworks/scope cd $GOPATH/src/github.com/weaveworks/scope -rm $1 2>/dev/null || true make BUILD_IN_CONTAINER=false $@