-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (41 loc) · 929 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
# Command parameters
GOCMD=go
DEP=dep
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
BINARY_NAME=release/avdb
BINARY_LINUX=$(BINARY_NAME)_linux_amd64
REGISTRY=avdb
all: test build
build:
$(GOBUILD) -o $(BINARY_NAME) -v
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_LINUX)
docker-compose down
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)
deps:
$(DEP) init
$(DEP) ensure
# Release container
#dev-env: build-linux docker-build docker-compose
dev-env: build-linux docker-compose
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_LINUX) -v
docker-compose:
docker-compose build
docker-compose up
# Tag container and publish to registry
publish-release: build-linux image-build tag publish
image-build:
docker build -t avdb . --no-cache
tag:
docker tag avdb:latest ${REGISTRY}
publish:
docker push ${REGISTRY}