forked from OpenBazaar/openbazaar-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·56 lines (41 loc) · 1.04 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
55
56
##
## Building
##
deploy:
./deploy.sh
build:
./build.sh
linux_binary:
./build.sh linux/amd64
##
## Protobuf compilation
##
P_TIMESTAMP = Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp
P_ANY = Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any
PKGMAP = $(P_TIMESTAMP),$(P_ANY)
protos:
cd pb/protos && protoc --go_out=$(PKGMAP):.. *.proto
##
## Docker
##
DOCKER_PROFILE ?= openbazaar
DOCKER_SERVER_IMAGE_NAME ?= $(DOCKER_PROFILE)/server
DOCKER_DUMMY_IMAGE_NAME ?= $(DOCKER_PROFILE)/server_dummy
docker:
docker build -t $(DOCKER_SERVER_IMAGE_NAME) .
push_docker:
docker push $(DOCKER_SERVER_IMAGE_NAME)
deploy_docker: docker push_docker
dummy_docker:
docker build -t $(DOCKER_DUMMY_IMAGE_NAME) -f Dockerfile.dummy .
push_dummy_docker:
docker push $(DOCKER_DUMMY_IMAGE_NAME)
deploy_dummy_docker: dummy_docker push_dummy_docker
##
## Cleanup
##
clean_build:
rm -f ./dist/*
clean_docker:
docker rmi -f $(DOCKER_SERVER_IMAGE_NAME) $(DOCKER_DUMMY_IMAGE_NAME) || true
clean: clean_build clean_docker