Skip to content
Permalink
Browse files

Merge pull request #177 from weaveworks/fix-coveralls

Fix coveralls
  • Loading branch information...
errordeveloper committed Aug 28, 2018
2 parents e002785 + 0734ff0 commit 8647f49136eb78bbe021ab8a81831bb1f6287e7c
Showing with 55 additions and 54 deletions.
  1. +0 −16 .circleci/config.yml
  2. +3 −2 Dockerfile
  3. +17 −30 Makefile
  4. +1 −4 build/Dockerfile
  5. +25 −2 build/Gopkg.lock
  6. +2 −0 build/Gopkg.toml
  7. +7 −0 build/install.sh
@@ -11,27 +11,11 @@ jobs:
steps:
- checkout
- run: make release
coverage:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/weaveworks/eksctl
steps:
- checkout
- restore_cache:
keys:
- v1-pkg-cache
- run: make setup-coverage
- run: make test-with-coverage
- save_cache:
key: v1-pkg-cache
paths:
- "/go/pkg"

workflows:
version: 2
any-commit:
jobs:
- coverage
- make-eksctl-image:
filters:
tags:
@@ -21,12 +21,13 @@ RUN apk add --no-cache --initdb --root /out \
python \
&& true

RUN go get github.com/jteeuwen/go-bindata/go-bindata

ENV EKSCTL $GOPATH/src/github.com/weaveworks/eksctl
RUN mkdir -p "$(dirname ${EKSCTL})"
COPY . $EKSCTL

ARG COVERALLS_TOKEN
ENV COVERALLS_TOKEN $COVERALLS_TOKEN

WORKDIR $EKSCTL
RUN make test && make \
&& cp ./eksctl /out/usr/local/bin/eksctl
@@ -6,51 +6,38 @@ EKSCTL_IMAGE ?= weaveworks/eksctl:latest

.PHONY: build
build:
go build -ldflags "-X main.gitCommit=$(git_commit) -X main.builtAt=$(built_at)" ./cmd/eksctl
@go build -ldflags "-X main.gitCommit=$(git_commit) -X main.builtAt=$(built_at)" ./cmd/eksctl

.PHONY: install-build-deps
install-build-deps:
@cd build && dep ensure && ./install.sh

.PHONY: test
test:
go test -v ./pkg/... ./cmd/...

.PHONY: test-with-coverage
test-with-coverage:
go test -v -covermode=count -coverprofile=coverage.out ./pkg/... ./cmd/...
goveralls -coverprofile=coverage.out -service=circle-ci

.PHONY: setup-coverage
setup-coverage:
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
go get github.com/mattn/goveralls

.PHONY: update-bindata
update-bindata:
go generate ./pkg/eks
@go test -v -covermode=count -coverprofile=coverage.out ./pkg/... ./cmd/...
@test -z $(COVERALLS_TOKEN) || goveralls -coverprofile=coverage.out -service=circle-ci

.PHONY: install-bindata
install-bindata:
go get -u github.com/jteeuwen/go-bindata/...

.PHONY: update-mockery
update-mockery:
go generate ./pkg/eks/mocks

.PHONY: install-mockery
install-mockery:
go get -u github.com/vektra/mockery/cmd/mockery
.PHONY: generated
generate:
@go generate ./pkg/eks ./pkg/eks/mocks

.PHONY: eksctl-build-image
eksctl-build-image:
@-docker pull $(EKSCTL_BUILD_IMAGE)
@docker build --tag=$(EKSCTL_BUILD_IMAGE) --cache-from=$(EKSCTL_BUILD_IMAGE) ./build

EKSCTL_IMAGE_BUILD_ARGS := --build-arg=EKSCTL_BUILD_IMAGE=$(EKSCTL_BUILD_IMAGE)
ifneq ($(COVERALLS_TOKEN),)
EKSCTL_IMAGE_BUILD_ARGS += --build-arg=COVERALLS_TOKEN=$(COVERALLS_TOKEN)
endif

.PHONY: eksctl-image
eksctl-image: eksctl-build-image
@docker build --tag=$(EKSCTL_IMAGE) --build-arg=EKSCTL_BUILD_IMAGE=$(EKSCTL_BUILD_IMAGE) ./
@docker build --tag=$(EKSCTL_IMAGE) $(EKSCTL_IMAGE_BUILD_ARGS) ./

.PHONY: release
release: eksctl-build-image
docker run \
@docker run \
--env=GITHUB_TOKEN \
--env=CIRCLE_TAG \
--env=CIRCLE_PROJECT_USERNAME \
@@ -22,12 +22,9 @@ RUN dep ensure

WORKDIR $EKSCTL_BUILD

RUN go install ./vendor/github.com/jteeuwen/go-bindata/go-bindata
RUN go install ./vendor/github.com/weaveworks/github-release
RUN go install ./vendor/golang.org/x/tools/cmd/stringer
RUN ./install.sh

WORKDIR $EKSCTL_BUILD/vendor/github.com/goreleaser/goreleaser
RUN make build && go install


WORKDIR $GOPATH

Some generated files are not rendered by default. Learn more.

@@ -1,6 +1,8 @@
required = [
"github.com/goreleaser/goreleaser",
"github.com/jteeuwen/go-bindata/go-bindata",
"github.com/mattn/goveralls",
"github.com/vektra/mockery/cmd/mockery",
"github.com/weaveworks/github-release",
"golang.org/x/tools/cmd/stringer",
]
@@ -0,0 +1,7 @@
#!/bin/sh

go install ./vendor/github.com/jteeuwen/go-bindata/go-bindata
go install ./vendor/github.com/weaveworks/github-release
go install ./vendor/golang.org/x/tools/cmd/stringer
go install ./vendor/github.com/mattn/goveralls
go install ./vendor/github.com/vektra/mockery/cmd/mockery

0 comments on commit 8647f49

Please sign in to comment.
You can’t perform that action at this time.