-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (40 loc) · 1.07 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
# application name
APP = vault-handler
# build directory
BUILD_DIR ?= build
# docker image tag
DOCKER_IMAGE ?= "otaviof/$(APP)"
# directory containing end-to-end tests
E2E_TEST_DIR ?= test/e2e
# project version, used as docker tag
VERSION ?= $(shell cat ./version)
.PHONY: default bootstrap build clean test
default: build
dep:
go get -u github.com/golang/dep/cmd/dep
bootstrap:
dep ensure -v -vendor-only
build: clean
go build -v -o $(BUILD_DIR)/$(APP) cmd/$(APP)/*
build-docker:
docker build --tag $(DOCKER_IMAGE):$(VERSION) .
clean:
rm -rf $(BUILD_DIR) > /dev/null
clean-vendor:
rm -rf ./vendor > /dev/null
run:
go run -v cmd/$(APP)/* $(filter-out $@,$(MAKECMDGOALS)) ; exit $?
test:
go test -failfast -race -coverprofile=coverage.txt -covermode=atomic -cover -v pkg/$(APP)/*
integration:
go test -failfast -v $(E2E_TEST_DIR)/*
codecov:
mkdir .ci || true
curl -s -o .ci/codecov.sh https://codecov.io/bash
bash .ci/codecov.sh -t $(CODECOV_TOKEN)
snapshot:
goreleaser --rm-dist --snapshot
release:
git tag $(VERSION)
git push origin $(VERSION)
goreleaser --rm-dist