-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 1020 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
44
45
46
47
48
49
50
51
52
53
54
55
56
VERSION:=0.1
TAG:=v$(VERSION)
COVEROUT = cover.out
GOFMTCHECK = test -z `gofmt -l -s -w *.go | tee /dev/stderr`
GOTEST = go test -v
COVER = $(GOTEST) -coverprofile=$(COVEROUT) -covermode=atomic -race
GOPATH?=$(HOME)/go
all: fmt test
.PHONY: build
build: fmt
.PHONY: push
push:
@echo "Starting push..."
@echo "Nothing to push..."
@echo "Finishing push..."
.PHONY: fmt
fmt:
@echo "Checking format..."
@$(GOFMTCHECK)
.PHONY: test
test:
@echo "Running tests..."
@$(COVER)
# Docker targets
.PHONY: docker
docker:
rm coredns || true
cp /home/rodrigo/projects/coredns/coredns .
docker build -t coredns-drop . --no-cache
.PHONY: run
run:
docker run \
-p 25353:53/udp \
-p 15353:15353 \
-v $(shell pwd)/Corefile:/etc/coredns/Corefile \
--rm --name coredns-drop \
coredns-drop
# Use the 'release' target to start a release
.PHONY: release
release: commit push
@echo Released $(VERSION)
.PHONY: commit
commit:
@echo Committing release $(VERSION)
git commit -am"Release $(VERSION)"
git tag $(TAG)