This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 285
(#1892) QA Runner improvements for use in CI #1910
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4f6bac6
Add qa.sh script
hoffmabc dfffbeb
QA dockerfile
hoffmabc 3e1015d
Add QA docker commands to Makefile
hoffmabc 51b43b1
Add openbazaard and qa targets to Makefile; Fix docker build targets
placer14 232c4ab
Refactor Dockerfile.qa
placer14 68d1e97
Refactor Dockerfile.dev to derive from latest Dockerfile.qa
placer14 91d9ffc
Point Dockfiles at public Docker Hub repo; Add make help
placer14 ec7f549
Update make openbazaard command to not include tag
placer14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM golang:1.11 | ||
|
||
ENV BITCOIND_VERSION=0.16.3 | ||
ENV BITCOIND_PATH=/opt/bitcoin-${BITCOIND_VERSION} | ||
|
||
# software installs, from most stable to most volatile | ||
RUN apt-get update -y | ||
RUN apt-get install -yq software-properties-common \ | ||
zlib1g-dev \ | ||
libssl-dev \ | ||
unzip \ | ||
python3 \ | ||
python3-pip | ||
|
||
RUN wget https://github.com/google/protobuf/releases/download/v3.6.0/protoc-3.6.0-linux-x86_64.zip && \ | ||
unzip ./protoc-3.6.0-linux-x86_64.zip -x readme.txt && \ | ||
mv ./include/* /usr/local/include/ && \ | ||
mv ./bin/protoc /usr/local/bin/ && \ | ||
rm -rf ./include ./bin | ||
|
||
COPY ./qa/requirements.txt ./requirements.txt | ||
|
||
RUN python3 -m pip install --upgrade pip && \ | ||
pip install -r ./requirements.txt && \ | ||
wget https://bitcoin.org/bin/bitcoin-core-0.16.3/bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz && \ | ||
tar -xvzf bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz -C /opt | ||
|
||
WORKDIR /go/src/github.com/OpenBazaar/openbazaar-go | ||
|
||
COPY ./Makefile ./Makefile | ||
|
||
VOLUME /go/src/github.com/OpenBazaar/openbazaar-go | ||
|
||
CMD make qa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
GIT_SHA ?= $(shell git rev-parse --short=8 HEAD) | ||
GIT_TAG ?= $(shell git describe --tags --abbrev=0) | ||
|
||
## | ||
## Building | ||
## | ||
|
||
.PHONY: ios_framework | ||
ios_framework: | ||
gomobile bind -target=ios github.com/OpenBazaar/openbazaar-go/mobile | ||
|
||
.PHONY: android_framework | ||
android_framework: | ||
gomobile bind -target=android github.com/OpenBazaar/openbazaar-go/mobile | ||
|
||
|
@@ -20,17 +25,51 @@ PKGMAP = $(P_TIMESTAMP),$(P_ANY) | |
protos: | ||
cd pb/protos && PATH=$(PATH):$(GOPATH)/bin protoc --go_out=$(PKGMAP):.. *.proto | ||
|
||
|
||
## | ||
## Testing | ||
## | ||
|
||
OPENBAZAARD_NAME ?= openbazaard-$(GIT_TAG)-$(GIT_SHA) | ||
BITCOIND_PATH ?= . | ||
|
||
.PHONY: openbazaard | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't a phony make target. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was concerned that the build output makes an |
||
openbazaard: | ||
$(info "Building openbazaar daemon...") | ||
go build -o ./$(OPENBAZAARD_NAME) . | ||
|
||
.PHONY: qa | ||
qa: openbazaard | ||
$(info "Running QA... (openbazaard: ../$(OPENBAZAARD_NAME) bitcoind: $(BITCOIND_PATH)/bin/bitcoind)") | ||
(cd qa && ./runtests.sh ../$(OPENBAZAARD_NAME) $(BITCOIND_PATH)/bin/bitcoind) | ||
|
||
## | ||
## Docker | ||
## | ||
DOCKER_PROFILE ?= openbazaar | ||
DOCKER_VERSION ?= $(shell git describe --tags --abbrev=0) | ||
DOCKER_IMAGE_NAME ?= $(DOCKER_PROFILE)/server:$(DOCKER_VERSION) | ||
PUBLIC_DOCKER_REGISTRY ?= openbazaar | ||
OB_DOCKER_REGISTRY ?= docker.dev.ob1.io | ||
|
||
DOCKER_IMAGE_NAME ?= $(PUBLIC_DOCKER_REGISTRY_PROFILE)/server:$(GIT_TAG) | ||
DOCKER_QA_IMAGE_NAME ?= $(OB_DOCKER_REGISTRY)/openbazaar-qa:$(GIT_SHA) | ||
DOCKER_DEV_IMAGE_NAME ?= openbazaar-dev:$(GIT_SHA) | ||
|
||
|
||
.PHONY: docker | ||
docker: | ||
docker build -t $(DOCKER_IMAGE_NAME) . | ||
|
||
.PHONY: push_docker | ||
push_docker: | ||
push_docker: docker | ||
docker push $(DOCKER_IMAGE_NAME) | ||
|
||
.PHONY: qa_docker | ||
qa_docker: | ||
docker build -t $(DOCKER_QA_IMAGE_NAME) -f ./Dockerfile.qa . | ||
|
||
.PHONY: push_qa_docker | ||
push_qa_docker: qa_docker | ||
docker push $(DOCKER_QA_IMAGE_NAME) | ||
|
||
.PHONY: dev_docker | ||
dev_docker: | ||
docker build -t $(DOCKER_DEV_IMAGE_NAME) -f ./Dockerfile.dev . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 very nice
![image](https://user-images.githubusercontent.com/45482/70827879-2e86de00-1db8-11ea-90b6-3fa27f9f3953.png)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if anyone not authenticated against our registry will be able to pull this image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. @tyler-smith ?