forked from aayushrangwala/watermark-service
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathMakefile
35 lines (23 loc) · 730 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
PROJECT ?= watermark-service
IMAGE ?= watermark-service
VERSION ?= $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty)
all: lint test build
# Run lint
lint:
golangci-lint run ./pkg/... ./cmd/...
# Run tests
test:
go test -v ./pkg/... ./cmd/... -coverprofile coverage.out
test-coverage:
./scripts/test-coverage.sh coverage.out
run:
go run ./cmd/server/main.go
build:
docker build --cache-from docker.io/$(PROJECT)/$(IMAGE):latest \
-t docker.io/$(PROJECT)/$(IMAGE):$(VERSION) \
-t docker.io/$(PROJECT)/$(IMAGE):latest -f Dockerfile .
push:
docker push docker.io/$(PROJECT)/$(IMAGE):latest
docker push docker.io/$(PROJECT)/$(IMAGE):$(VERSION)
.PHONY: image push
release: lint test build push