-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (37 loc) · 883 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
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_LOC=bin
BINARY_NAME=rodo
DOCKER_REPOSITORY_OWNER=alwindoss
VERSION=0.0.1
all: build
protoc:
protoc api/v1/*.proto --go_out=. --go_opt=paths=source_relative --proto_path=.
docker:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./$(BINARY_LOC)/$(BINARY_NAME) -v
package:
docker build -t $(DOCKER_REPOSITORY_OWNER)/$(BINARY_NAME):$(VERSION) .
publish:
docker push $(DOCKER_REPOSITORY_OWNER)/$(BINARY_NAME):$(VERSION)
setup:
$(GOGET) -v ./...
build:
ifeq ($(OS),Windows_NT)
$(GOBUILD) -o ./$(BINARY_LOC)/$(BINARY_NAME).exe -v
else
$(GOBUILD) -o ./$(BINARY_LOC)/$(BINARY_NAME) -v
endif
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -rf $(BINARY_LOC)
run: clean build
ifeq ($(OS),Windows_NT)
./$(BINARY_LOC)/$(BINARY_NAME).exe
else
./$(BINARY_LOC)/$(BINARY_NAME)
endif