Skip to content

Commit

Permalink
update travis
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
Jess Frazelle committed Dec 29, 2018
1 parent 92b2b48 commit 4f8956d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ jobs:
on:
tags: true
api_key:
secure: "LMrByDP/cIjxaGdXAOrDGtlzsiBt//LRrhrwpdimdl6rnijkc+NlhRhGNItceJzQLs6kz5sihHY1YVaeqzJXnJ+Eo4b0Kz1BQwpOk5DRn85y+tTg2G7HvCIjrWsVleCnbmAK/IbOsVdY7HlK7s0i9eG+7fYfSGiNMevwwtfQjiKH3yFu+nUPPH4Z85Lvz8Wvjg0Nmhnt+nY4R7IFHgMNVGsUn1qjUrrCK8X9fuY3ulnK6nghQ/KSrxyJdkfWWOqs8EfxMpcKH6iL5wYeAXxEFp97WJiqjqIh2RfGjB4q/nRWVWDviVUxUxrgIFh4AEtZMphdKsNhoyyLMZB42O1daP7SCR498xeCZLpx4jTfOTJ6QhD2zJ56rkXlvcEDomCIo+A3fHUiknKLmEnRE6aQQTkn3E49D7A+GG15x/3ec6WBizR1Ht8nMxDh7Z5glVqs8Sf/AHry3RLEYbO6HS2j3Axx6yS9dg5K8keOpKygVpyNNFUb1KDpO/ZJdq4GaBqyjHZoh/PBNvYxHsMhVL9L57LBabckV5pTjGunTTY6CHmhPdzWCVCl1SRRUw1spqZMxydQSkxYd04QqAVsb3vw4f+iA0uTSgWRKpcC0CVjiML1BIxnjXDmBP7v6+oVaEHF9Gyj9+StvodS7GUWScL8p1NvQlHaC4bdzKytMTMuzmc="
secure: "JISwosvCCw3O4FqbCr1cwMfa7wnQy1yrtmlkxXrgfnawWc1rJQHZr1oGNVapPOix+vUNiBCUFU3jFw74tOTmRkvH4ldlJd36TVr814gdfzIpX6Z5bGZJlJpR7MLBjJ7ETaWiGtTcLS7MwejIwqtCjgMwGp3h3iHO8c5BfRZQT9ZKkmZZn5hbfiFo1pxI9nkytMq2bSb8InUarZylgPAD2P0x4VRhgQxW+hpmex7yFSsi0R7dQjTD0dDPOu/Dls0XiocyG1wbMNjo3cQ+EsStwwPxI4MCUW+A/MPObcMWGOFaDhl6MrR3YclbXw0+O9GKljzoPNoMra1UgZG/fddWxMML1dzxCBBHeXwntTyE8pjMWbeRMHNomqoEABiZSoYPnCpE3Lsi1paCRw5JGiDeIWAVa46TiEQYkq1Ui3stkmjGeUtfd3TsXEFke50POfw5UP19eWD1onl1M3i0nJ01JPImMDwW3jP0k5hDMqQCGQPJRxe5k3lhVvOCi6ePcljlj2mPQf3OiPKsJUNKkmZ+EUOq78cys9vC0XRipG689pj5k6IP2Dv7s0DG8+wCg1Is1KaEzU6s4Tm17bFrPkNZ4o6Mye+KW4V4qv2duc9OyU5jmm8Sk09RFsnxWPSMG4mvGmDtsvRoDJa6RDkID5JfO6zNSunGs4hBKf65HcOtGeU="
2 changes: 1 addition & 1 deletion .traviskey
Original file line number Diff line number Diff line change
@@ -1 +1 @@
LMrByDP/cIjxaGdXAOrDGtlzsiBt//LRrhrwpdimdl6rnijkc+NlhRhGNItceJzQLs6kz5sihHY1YVaeqzJXnJ+Eo4b0Kz1BQwpOk5DRn85y+tTg2G7HvCIjrWsVleCnbmAK/IbOsVdY7HlK7s0i9eG+7fYfSGiNMevwwtfQjiKH3yFu+nUPPH4Z85Lvz8Wvjg0Nmhnt+nY4R7IFHgMNVGsUn1qjUrrCK8X9fuY3ulnK6nghQ/KSrxyJdkfWWOqs8EfxMpcKH6iL5wYeAXxEFp97WJiqjqIh2RfGjB4q/nRWVWDviVUxUxrgIFh4AEtZMphdKsNhoyyLMZB42O1daP7SCR498xeCZLpx4jTfOTJ6QhD2zJ56rkXlvcEDomCIo+A3fHUiknKLmEnRE6aQQTkn3E49D7A+GG15x/3ec6WBizR1Ht8nMxDh7Z5glVqs8Sf/AHry3RLEYbO6HS2j3Axx6yS9dg5K8keOpKygVpyNNFUb1KDpO/ZJdq4GaBqyjHZoh/PBNvYxHsMhVL9L57LBabckV5pTjGunTTY6CHmhPdzWCVCl1SRRUw1spqZMxydQSkxYd04QqAVsb3vw4f+iA0uTSgWRKpcC0CVjiML1BIxnjXDmBP7v6+oVaEHF9Gyj9+StvodS7GUWScL8p1NvQlHaC4bdzKytMTMuzmc=
JISwosvCCw3O4FqbCr1cwMfa7wnQy1yrtmlkxXrgfnawWc1rJQHZr1oGNVapPOix+vUNiBCUFU3jFw74tOTmRkvH4ldlJd36TVr814gdfzIpX6Z5bGZJlJpR7MLBjJ7ETaWiGtTcLS7MwejIwqtCjgMwGp3h3iHO8c5BfRZQT9ZKkmZZn5hbfiFo1pxI9nkytMq2bSb8InUarZylgPAD2P0x4VRhgQxW+hpmex7yFSsi0R7dQjTD0dDPOu/Dls0XiocyG1wbMNjo3cQ+EsStwwPxI4MCUW+A/MPObcMWGOFaDhl6MrR3YclbXw0+O9GKljzoPNoMra1UgZG/fddWxMML1dzxCBBHeXwntTyE8pjMWbeRMHNomqoEABiZSoYPnCpE3Lsi1paCRw5JGiDeIWAVa46TiEQYkq1Ui3stkmjGeUtfd3TsXEFke50POfw5UP19eWD1onl1M3i0nJ01JPImMDwW3jP0k5hDMqQCGQPJRxe5k3lhVvOCi6ePcljlj2mPQf3OiPKsJUNKkmZ+EUOq78cys9vC0XRipG689pj5k6IP2Dv7s0DG8+wCg1Is1KaEzU6s4Tm17bFrPkNZ4o6Mye+KW4V4qv2duc9OyU5jmm8Sk09RFsnxWPSMG4mvGmDtsvRoDJa6RDkID5JfO6zNSunGs4hBKf65HcOtGeU=
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go

RUN apk add --no-cache \
bash \
ca-certificates

COPY . /go/src/github.com/genuinetools/bane
Expand Down
54 changes: 45 additions & 9 deletions basic.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Set the shell
SHELL := /bin/bash

# Set an output prefix, which is the local directory if not specified
PREFIX?=$(shell pwd)

Expand Down Expand Up @@ -25,6 +28,18 @@ GO := go
# List the GOOS and GOARCH to build
GOOSARCHES = $(shell cat .goosarch)

# Set the graph driver as the current graphdriver if not set.
DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
export DOCKER_GRAPHDRIVER

# If this session isn't interactive, then we don't want to allocate a
# TTY, which would fail, but if it is interactive, we do want to attach
# so that the user can send e.g. ^C through.
INTERACTIVE := $(shell [ -t 0 ] && echo 1 || echo 0)
ifeq ($(INTERACTIVE), 1)
DOCKER_FLAGS += -t
endif

.PHONY: build
build: prebuild $(NAME) ## Builds a dynamic executable or package.

Expand All @@ -44,12 +59,16 @@ all: clean build fmt lint test staticcheck vet install ## Runs a clean, build, f
.PHONY: fmt
fmt: ## Verifies all files have been `gofmt`ed.
@echo "+ $@"
@gofmt -s -l . | grep -v '.pb.go:' | grep -v vendor | tee /dev/stderr
@if [[ ! -z "$(shell gofmt -s -l . | grep -v '.pb.go:' | grep -v '.twirp.go:' | grep -v vendor | tee /dev/stderr)" ]]; then \
exit 1; \
fi

.PHONY: lint
lint: ## Verifies `golint` passes.
@echo "+ $@"
@golint ./... | grep -v '.pb.go:' | grep -v vendor | tee /dev/stderr
@if [[ ! -z "$(shell golint ./... | grep -v '.pb.go:' | grep -v '.twirp.go:' | grep -v vendor | tee /dev/stderr)" ]]; then \
exit 1; \
fi

.PHONY: test
test: prebuild ## Runs the go tests.
Expand All @@ -59,12 +78,16 @@ test: prebuild ## Runs the go tests.
.PHONY: vet
vet: ## Verifies `go vet` passes.
@echo "+ $@"
@$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
@if [[ ! -z "$(shell $(GO) vet $(shell $(GO) list ./... | grep -v vendor) | tee /dev/stderr)" ]]; then \
exit 1; \
fi

.PHONY: staticcheck
staticcheck: ## Verifies `staticcheck` passes.
@echo "+ $@"
@staticcheck $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
@if [[ ! -z "$(shell staticcheck $(shell $(GO) list ./... | grep -v vendor) | tee /dev/stderr)" ]]; then \
exit 1; \
fi

.PHONY: cover
cover: prebuild ## Runs go test with coverage.
Expand Down Expand Up @@ -134,6 +157,10 @@ REGISTRY := r.j3ss.co
image: ## Create the docker image from the Dockerfile.
@docker build --rm --force-rm -t $(REGISTRY)/$(NAME) .

.PHONY: image-dev
image-dev:
@docker build --rm --force-rm -f Dockerfile.dev -t $(REGISTRY)/$(NAME):dev .

.PHONY: AUTHORS
AUTHORS:
@$(file >$@,# This file lists all individuals having contributed content to the repository.)
Expand All @@ -142,12 +169,12 @@ AUTHORS:

.PHONY: vendor
vendor: ## Updates the vendoring directory.
@$(RM) Gopkg.toml Gopkg.lock
@$(RM) go.mod go.sum
@$(RM) go.sum
@$(RM) -r vendor
@GO111MODULE=on $(GO) mod init
@GO111MODULE=on $(GO) mod tidy
@GO111MODULE=on $(GO) mod vendor
GO111MODULE=on $(GO) mod init || true
GO111MODULE=on $(GO) mod tidy
GO111MODULE=on $(GO) mod vendor
@$(RM) Gopkg.toml Gopkg.lock

.PHONY: clean
clean: ## Cleanup any build binaries or packages.
Expand All @@ -158,3 +185,12 @@ clean: ## Cleanup any build binaries or packages.
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | sed 's/^[^:]*://g' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))

__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))$(if $(value @), \
required by target `$@')))

0 comments on commit 4f8956d

Please sign in to comment.