Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 13d28b1

Browse files
committed
Rebase to ethereum-master
2 parents 41237fb + 09c1138 commit 13d28b1

File tree

158 files changed

+7566
-8143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+7566
-8143
lines changed

Dockerfile.dev

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
1-
FROM golang:1.11
2-
VOLUME /var/lib/openbazaar
3-
4-
RUN wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz && \
5-
tar xvf Python-3.6.0.tgz && \
6-
cd Python-3.6.0 && \
7-
./configure --enable-optimizations && \
8-
make -j8
9-
RUN apt-get update && apt-get install -yq zlib1g-dev libssl-dev unzip
10-
RUN cd Python-3.6.0 && \
11-
make altinstall && \
12-
ln -s /usr/local/bin/python3.6 /usr/local/bin/python3
13-
14-
COPY ./qa/requirements.txt ./requirements.txt
15-
16-
RUN pip3.6 install --upgrade pip && \
17-
pip3.6 install -r requirements.txt && \
18-
wget https://bitcoin.org/bin/bitcoin-core-0.16.3/bitcoin-0.16.3-x86_64-linux-gnu.tar.gz && \
19-
tar -xvzf bitcoin-0.16.3-x86_64-linux-gnu.tar.gz -C /opt
20-
21-
RUN wget https://github.com/google/protobuf/releases/download/v3.6.0/protoc-3.6.0-linux-x86_64.zip && \
22-
unzip ./protoc-3.6.0-linux-x86_64.zip -x readme.txt && \
23-
mv ./include/* /usr/local/include/ && \
24-
mv ./bin/protoc /usr/local/bin/ && \
25-
rm -rf ./include ./bin
1+
FROM openbazaar/server-qa:0.10
262

273
RUN go get -u github.com/gogo/protobuf/proto \
284
github.com/golang/protobuf/protoc-gen-go \

Dockerfile.qa

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM golang:1.11
2+
3+
ENV BITCOIND_VERSION=0.16.3
4+
ENV BITCOIND_PATH=/opt/bitcoin-${BITCOIND_VERSION}
5+
6+
# software installs, from most stable to most volatile
7+
RUN apt-get update -y
8+
RUN apt-get install -yq software-properties-common \
9+
zlib1g-dev \
10+
libssl-dev \
11+
unzip \
12+
python3 \
13+
python3-pip
14+
15+
RUN wget https://github.com/google/protobuf/releases/download/v3.6.0/protoc-3.6.0-linux-x86_64.zip && \
16+
unzip ./protoc-3.6.0-linux-x86_64.zip -x readme.txt && \
17+
mv ./include/* /usr/local/include/ && \
18+
mv ./bin/protoc /usr/local/bin/ && \
19+
rm -rf ./include ./bin
20+
21+
COPY ./qa/requirements.txt ./requirements.txt
22+
23+
RUN python3 -m pip install --upgrade pip && \
24+
pip install -r ./requirements.txt && \
25+
wget https://bitcoin.org/bin/bitcoin-core-0.16.3/bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz && \
26+
tar -xvzf bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz -C /opt
27+
28+
WORKDIR /go/src/github.com/OpenBazaar/openbazaar-go
29+
30+
COPY ./Makefile ./Makefile
31+
32+
VOLUME /go/src/github.com/OpenBazaar/openbazaar-go
33+
34+
CMD make qa_test

Godeps/Godeps.json

Lines changed: 35 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 76 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
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+
119
##
220
## Building
321
##
422

5-
ios_framework:
23+
.PHONY: ios_framework
24+
ios_framework: ## Build iOS Framework for mobile
625
gomobile bind -target=ios github.com/OpenBazaar/openbazaar-go/mobile
726

8-
android_framework:
27+
.PHONY: android_framework
28+
android_framework: ## Build Android Framework for mobile
929
gomobile bind -target=android github.com/OpenBazaar/openbazaar-go/mobile
1030

1131
##
@@ -17,32 +37,62 @@ P_ANY = Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any
1737
PKGMAP = $(P_TIMESTAMP),$(P_ANY)
1838

1939
.PHONY: protos
20-
protos:
40+
protos: ## Build go files for proto definitions
2141
cd pb/protos && PATH=$(PATH):$(GOPATH)/bin protoc --go_out=$(PKGMAP):.. *.proto
2242

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+
60+
.PHONY: qa_eth_test
61+
qa_eth_test: openbazaard ## Run ETH-based QA test suite against current working copy
62+
$(info "Running ETH QA... (openbazaard: ../$(OPENBAZAARD_NAME))")
63+
(cd qa && ./runtests_eth.sh ../$(OPENBAZAARD_NAME))
64+
2365
##
2466
## Docker
2567
##
26-
DOCKER_PROFILE ?= openbazaar
27-
DOCKER_VERSION ?= $(shell git describe --tags --abbrev=0)
28-
DOCKER_IMAGE_NAME ?= $(DOCKER_PROFILE)/server:$(DOCKER_VERSION)
29-
30-
.PHONY: docker
31-
docker:
32-
docker build -t $(DOCKER_IMAGE_NAME) .
33-
34-
.PHONY: push_docker
35-
push_docker:
36-
docker push $(DOCKER_IMAGE_NAME)
37-
38-
.PHONY: qa
39-
qa:
40-
go build -o ./openbazaar-qa ./openbazaard.go
41-
(cd qa && ./runtests.sh ../openbazaar-qa /opt/bitcoin-0.16.3/bin/bitcoind)
42-
rm ./openbazaar-qa
43-
44-
.PHONY: qa_eth
45-
qa_eth:
46-
go build -o ./openbazaar-qa ./openbazaard.go
47-
(cd qa && ./runtests_eth.sh ../openbazaar-qa)
48-
rm ./openbazaar-qa
68+
PUBLIC_DOCKER_REGISTRY ?= openbazaar
69+
QA_DEV_TAG ?= 0.10
70+
71+
DOCKER_SERVER_IMAGE_NAME ?= $(PUBLIC_DOCKER_REGISTRY)/server:$(GIT_TAG)
72+
DOCKER_QA_IMAGE_NAME ?= $(PUBLIC_DOCKER_REGISTRY)/server-qa:$(QA_DEV_TAG)
73+
DOCKER_DEV_IMAGE_NAME ?= $(PUBLIC_DOCKER_REGISTRY)/server-dev:$(QA_DEV_TAG)
74+
75+
76+
.PHONY: docker_build
77+
docker_build: ## Build container for daemon
78+
docker build -t $(DOCKER_SERVER_IMAGE_NAME) .
79+
80+
.PHONY: docker_push
81+
docker_push: docker ## Push container for daemon
82+
docker push $(DOCKER_SERVER_IMAGE_NAME)
83+
84+
.PHONY: qa_docker_build
85+
qa_docker_build: ## Build container with QA test dependencies included
86+
docker build -t $(DOCKER_QA_IMAGE_NAME) -f ./Dockerfile.qa .
87+
88+
.PHONY: qa_docker_push
89+
qa_docker_push: qa_docker_build ## Push container for daemon QA test environment
90+
docker push $(DOCKER_QA_IMAGE_NAME)
91+
92+
.PHONY: dev_docker_build
93+
dev_docker: ## Build container with dev dependencies included
94+
docker build -t $(DOCKER_DEV_IMAGE_NAME) -f ./Dockerfile.dev .
95+
96+
.PHONY: dev_docker_push
97+
dev_docker_push: dev_docker_build ## Push container for daemon dev environment
98+
docker push $(DOCKER_DEV_IMAGE_NAME)

0 commit comments

Comments
 (0)