1
+ .DEFAULT_GOAL := help
2
+
3
+ # #
4
+ # # Global ENV vars
5
+ # #
6
+
7
+ GIT_SHA ?= $(shell git rev-parse --short=8 HEAD)
8
+ GIT_TAG ?= $(shell git describe --tags --abbrev=0)
9
+
10
+ # #
11
+ # # Helpful Help
12
+ # #
13
+
14
+ .PHONY : help
15
+ help :
16
+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
17
+
18
+
1
19
# #
2
20
# # Building
3
21
# #
4
22
5
- ios_framework :
23
+ .PHONY : ios_framework
24
+ ios_framework : # # Build iOS Framework for mobile
6
25
gomobile bind -target=ios github.com/OpenBazaar/openbazaar-go/mobile
7
26
8
- android_framework :
27
+ .PHONY : android_framework
28
+ android_framework : # # Build Android Framework for mobile
9
29
gomobile bind -target=android github.com/OpenBazaar/openbazaar-go/mobile
10
30
11
31
# #
@@ -17,20 +37,57 @@ P_ANY = Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any
17
37
PKGMAP = $(P_TIMESTAMP ) ,$(P_ANY )
18
38
19
39
.PHONY : protos
20
- protos :
40
+ protos : # # Build go files for proto definitions
21
41
cd pb/protos && PATH=$(PATH ) :$(GOPATH ) /bin protoc --go_out=$(PKGMAP ) :.. * .proto
22
42
43
+
44
+ # #
45
+ # # Testing
46
+ # #
47
+ OPENBAZAARD_NAME ?= openbazaard-$(GIT_SHA )
48
+ BITCOIND_PATH ?= .
49
+
50
+ .PHONY : openbazaard
51
+ openbazaard : # # Build daemon
52
+ $(info "Building openbazaar daemon...")
53
+ go build -o ./$(OPENBAZAARD_NAME ) .
54
+
55
+ .PHONY : qa_test
56
+ qa_test : openbazaard # # Run QA test suite against current working copy
57
+ $(info "Running QA... (openbazaard: ../$(OPENBAZAARD_NAME ) bitcoind: $(BITCOIND_PATH ) /bin/bitcoind) " )
58
+ (cd qa && ./runtests.sh ../$( OPENBAZAARD_NAME) $( BITCOIND_PATH) /bin/bitcoind)
59
+
23
60
# #
24
61
# # Docker
25
62
# #
26
- DOCKER_PROFILE ?= openbazaar
27
- DOCKER_VERSION ?= $(shell git describe --tags --abbrev=0)
28
- DOCKER_IMAGE_NAME ?= $(DOCKER_PROFILE ) /server:$(DOCKER_VERSION )
63
+ PUBLIC_DOCKER_REGISTRY ?= openbazaar
64
+ QA_DEV_TAG ?= 0.10
65
+
66
+ DOCKER_SERVER_IMAGE_NAME ?= $(PUBLIC_DOCKER_REGISTRY ) /server:$(GIT_TAG )
67
+ DOCKER_QA_IMAGE_NAME ?= $(PUBLIC_DOCKER_REGISTRY ) /server-qa:$(QA_DEV_TAG )
68
+ DOCKER_DEV_IMAGE_NAME ?= $(PUBLIC_DOCKER_REGISTRY ) /server-dev:$(QA_DEV_TAG )
69
+
70
+
71
+ .PHONY : docker_build
72
+ docker_build : # # Build container for daemon
73
+ docker build -t $(DOCKER_SERVER_IMAGE_NAME ) .
74
+
75
+ .PHONY : docker_push
76
+ docker_push : docker # # Push container for daemon
77
+ docker push $(DOCKER_SERVER_IMAGE_NAME )
78
+
79
+ .PHONY : qa_docker_build
80
+ qa_docker_build : # # Build container with QA test dependencies included
81
+ docker build -t $(DOCKER_QA_IMAGE_NAME ) -f ./Dockerfile.qa .
82
+
83
+ .PHONY : qa_docker_push
84
+ qa_docker_push : qa_docker_build # # Push container for daemon QA test environment
85
+ docker push $(DOCKER_QA_IMAGE_NAME )
29
86
30
- .PHONY : docker
31
- docker :
32
- docker build -t $(DOCKER_IMAGE_NAME ) .
87
+ .PHONY : dev_docker_build
88
+ dev_docker : # # Build container with dev dependencies included
89
+ docker build -t $(DOCKER_DEV_IMAGE_NAME ) -f ./Dockerfile.dev .
33
90
34
- .PHONY : push_docker
35
- push_docker :
36
- docker push $(DOCKER_IMAGE_NAME )
91
+ .PHONY : dev_docker_push
92
+ dev_docker_push : dev_docker_build # # Push container for daemon dev environment
93
+ docker push $(DOCKER_DEV_IMAGE_NAME )
0 commit comments