Skip to content

Commit

Permalink
chore: bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Feb 23, 2020
1 parent ac91dbc commit 86542a1
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 50 deletions.
23 changes: 13 additions & 10 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 30 additions & 16 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 15 additions & 18 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ endif
ifdef GOPKG
GO ?= go
GOPATH ?= $(HOME)/go
GOLIBS ?= $(shell find . -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq)
GO_INSTALL_OPTS ?=
GO_TEST_OPTS ?= -test.timeout=30s
GOMOD_DIR ?= .

ifdef GOBINS
.PHONY: go.install
Expand All @@ -89,12 +89,10 @@ go.release:
RELEASE_STEPS += go.release
endif

.PHONY: go.unittest coverage.txt
go.unittest: coverage.txt
coverage.txt:
@rm -f /tmp/coverage.txt
@touch /tmp/coverage.txt
@set -e; for dir in $(GOLIBS); do ( set -xe; \
.PHONY: go.unittest
go.unittest:
echo "" > /tmp/coverage.txt
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do ( set -xe; \
cd $$dir; \
$(GO) test $(GO_TEST_OPTS) -cover -coverprofile=/tmp/profile.out -covermode=atomic -race ./...; \
if [ -f /tmp/profile.out ]; then \
Expand All @@ -103,44 +101,40 @@ coverage.txt:
fi); done
mv /tmp/coverage.txt .

.PHONY: go.coverfunc
go.coverfunc: coverage.txt
go tool cover -func=./coverage.txt | grep -v .pb.go: | grep -v .pb.gw.go:

.PHONY: go.lint
go.lint:
@set -e; for dir in $(GOLIBS); do ( set -xe; \
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do ( set -xe; \
cd $$dir; \
golangci-lint run --verbose ./...; \
); done

.PHONY: go.tidy
go.tidy:
@set -e; for dir in $(GOLIBS); do ( set -xe; \
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do ( set -xe; \
cd $$dir; \
$(GO) mod tidy; \
); done

.PHONY: go.build
go.build:
@set -e; for dir in $(GOLIBS); do ( set -xe; \
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do ( set -xe; \
cd $$dir; \
$(GO) build ./...; \
); done

.PHONY: go.bump-deps
go.bumpdeps:
@set -e; for dir in $(GOLIBS); do ( set -xe; \
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do ( set -xe; \
cd $$dir; \
$(GO) get -u ./...; \
); done

.PHONY: go.bump-deps
go.fmt:
if ! command -v goimports &>/dev/null; then GO111MODULE=off go get golang.org/x/tools/cmd/goimports; fi
@set -e; for dir in $(GOLIBS); do ( set -xe; \
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do ( set -xe; \
cd $$dir; \
goimports -w . \
goimports -w `go list -f '{{.Dir}}' ./...)` \
); done

BUILD_STEPS += go.build
Expand Down Expand Up @@ -177,6 +171,9 @@ endif
## Docker
##

ifndef DOCKERFILE_PATH
DOCKERFILE_PATH = ./Dockerfile
endif
ifndef DOCKER_IMAGE
ifneq ($(wildcard Dockerfile),)
DOCKER_IMAGE = $(notdir $(PWD))
Expand All @@ -190,7 +187,7 @@ docker.build:
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VERSION=`git describe --tags --always` \
-t $(DOCKER_IMAGE) .
-t $(DOCKER_IMAGE) -f $(DOCKERFILE_PATH) $(dir $(DOCKERFILE_PATH))

BUILD_STEPS += docker.build
endif
Expand Down
Loading

0 comments on commit 86542a1

Please sign in to comment.