forked from aptible/supercronic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 803 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
SHELL=/bin/bash
VERSION=$(shell git describe --tags --always --dirty)
.PHONY: deps
deps:
go mod vendor
.PHONY: build
build:
go build -ldflags "-X main.Version=${VERSION}"
.PHONY: docker-build
docker-build:
docker build -t supercronic:${VERSION} --build-arg VERSION=${VERSION} .
.PHONY: unit
unit:
go test -v -race $$(go list ./... | grep -v /vendor/)
go vet $$(go list ./... | grep -v /vendor/)
.PHONY: integration
integration: VERSION=v1337
integration: build docker-build
bats integration
.PHONY: test
test: unit integration
true
.PHONY: vulncheck
vulncheck: build
govulncheck ./...
.PHONY: fmt
fmt:
gofmt -l -w ${GOFILES_NOVENDOR}
.PHONY: release
release:
./build.sh ${VERSION}
.DEFAULT_GOAL := test