Build experimental stuff in a container too

This commit is contained in:
Tom Wilkie
2015-10-26 16:11:16 +00:00
parent 62aed75550
commit fb49e146ad
3 changed files with 10 additions and 3 deletions

View File

@@ -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 $@

View File

@@ -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):

View File

@@ -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 ./...