From fb49e146ade4de23406e8253517536c8576e4a88 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 26 Oct 2015 16:11:16 +0000 Subject: [PATCH] Build experimental stuff in a container too --- backend/build.sh | 2 +- circle.yml | 2 +- experimental/Makefile | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/build.sh b/backend/build.sh index 6ad89abdb..81448d550 100755 --- a/backend/build.sh +++ b/backend/build.sh @@ -7,5 +7,5 @@ set -eux cd $GOPATH/src/github.com/weaveworks/scope rm $1 2>/dev/null || true -make BUILD_IN_CONTAINER=false $1 +make BUILD_IN_CONTAINER=false $@ diff --git a/circle.yml b/circle.yml index 9ec09aaf2..507ae2f29 100644 --- a/circle.yml +++ b/circle.yml @@ -42,7 +42,7 @@ test: - cd $SRCDIR; rm -f app/scope-app probe/scope-probe; GOARCH=arm make RM= app/scope-app probe/scope-probe - cd $SRCDIR; rm -f app/scope-app probe/scope-probe; GOOS=darwin make RM= app/scope-app probe/scope-probe - cd $SRCDIR; rm -f app/scope-app probe/scope-probe; make RM= - - cd $SRCDIR/experimental; make + - cd $SRCDIR/experimental; make RM= - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh setup) - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; eval $(./gce.sh hosts); ./setup.sh) - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; eval $(./gce.sh hosts); ./run_all.sh): diff --git a/experimental/Makefile b/experimental/Makefile index 1c5363686..03c426516 100644 --- a/experimental/Makefile +++ b/experimental/Makefile @@ -2,12 +2,19 @@ DIRS=$(shell find . -maxdepth 2 -name *.go -printf "%h\n" | uniq) TARGETS=$(join $(patsubst %,%/,$(DIRS)),$(DIRS)) +BUILD_IN_CONTAINER=true +RM=--rm all: $(TARGETS) +ifeq ($(BUILD_IN_CONTAINER),true) +$(TARGETS): + $(SUDO) docker run -ti $(RM) -v $(shell pwd)/../:/go/src/github.com/weaveworks/scope -e GOARCH -e GOOS \ + weaveworks/scope-backend-build -C experimental $@ +else $(TARGETS): - go get -tags netgo ./$(@D) go build -ldflags "-extldflags \"-static\"" -tags netgo -o $@ ./$(@D) +endif test: go test ./...