Skip to content

Commit

Permalink
Use build image from build-tools repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bboreham committed Jun 25, 2018
1 parent 4d24bd7 commit a8e3e55
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 47 deletions.
9 changes: 2 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ version: 2

# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
# Process to update the build container is:
# Check out desired version of this repo; 'make common-build/.uptodate'; docker push <name>
docker:
- image: weaveworks/common-build:circle20-cfa562b
- image: quay.io/weaveworks/build-golang:1.10.0-stretch
working_directory: /go/src/github.com/weaveworks/common

workflows:
Expand All @@ -22,9 +20,7 @@ jobs:
- checkout
- run:
name: Lint
command: |
touch common-build/.uptodate &&
make BUILD_IN_CONTAINER=false lint
command: "make BUILD_IN_CONTAINER=false lint"

test:
<<: *defaults
Expand All @@ -34,5 +30,4 @@ jobs:
name: Test
command: |
dep ensure &&
touch common-build/.uptodate &&
make BUILD_IN_CONTAINER=false test
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
IMAGE_PREFIX := weaveworks
IMAGE_TAG := $(shell ./tools/image-tag)
UPTODATE := .uptodate
BUILD_IMAGE=quay.io/weaveworks/build-golang:1.10.0-stretch

# Building Docker images is now automated. The convention is every directory
# with a Dockerfile in it builds an image calls quay.io/weaveworks/<dirname>.
Expand All @@ -23,8 +24,6 @@ DOCKER_IMAGE_DIRS=$(patsubst %/Dockerfile,%,$(DOCKERFILES))

all: $(UPTODATE_FILES)

common-build/$(UPTODATE): common-build/*

# All the boiler plate for building golang follows:
SUDO := $(shell docker info >/dev/null 2>&1 || echo "sudo -E")
BUILD_IN_CONTAINER := true
Expand All @@ -41,22 +40,22 @@ NETGO_CHECK = @strings $@ | grep cgo_stub\\\.go >/dev/null || { \

ifeq ($(BUILD_IN_CONTAINER),true)

lint test shell: common-build/$(UPTODATE)
lint test shell:
@mkdir -p $(shell pwd)/.pkg
$(SUDO) docker run $(RM) -ti \
-v $(shell pwd)/.pkg:/go/pkg \
-v $(shell pwd):/go/src/github.com/weaveworks/common \
$(IMAGE_PREFIX)/common-build $@
$(BUILD_IMAGE) $@

else

lint: common-build/$(UPTODATE)
lint:
./tools/lint -notestpackage -ignorespelling queriers -ignorespelling Queriers .

test: common-build/$(UPTODATE)
test:
./tools/test -no-go-get -netgo

shell: common-build/$(UPTODATE)
shell:
bash

endif
Expand Down
16 changes: 0 additions & 16 deletions common-build/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions common-build/build.sh

This file was deleted.

0 comments on commit a8e3e55

Please sign in to comment.