Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to CircleCI 2.0 #98

Merged
merged 3 commits into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 2

# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
docker:
- image: quay.io/weaveworks/build-golang:1.10.0-stretch
working_directory: /go/src/github.com/weaveworks/common

workflows:
version: 2
test-build-deploy:
jobs:
- lint
- test

jobs:
lint:
<<: *defaults
steps:
- checkout
- run:
name: Lint
command: "make BUILD_IN_CONTAINER=false lint"

test:
<<: *defaults
steps:
- checkout
- run:
name: Test
command: |
dep ensure &&
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
32 changes: 0 additions & 32 deletions circle.yml

This file was deleted.

15 changes: 0 additions & 15 deletions common-build/Dockerfile

This file was deleted.

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

This file was deleted.