From 1406f57e17c6549887728c70d7556d4deb0dcc61 Mon Sep 17 00:00:00 2001 From: yys Date: Wed, 25 Mar 2020 19:08:50 +0900 Subject: [PATCH] update docker script and circleci to automatically upload it (#334) --- .circleci/config.yml | 36 ++++--------------- Dockerfile | 8 ++--- Makefile | 26 +------------- docker-compose.yml | 8 ++--- networks/local/Makefile | 2 +- .../local/{terradnode => core}/Dockerfile | 2 +- .../local/{terradnode => core}/wrapper.sh | 0 7 files changed, 17 insertions(+), 65 deletions(-) rename networks/local/{terradnode => core}/Dockerfile (93%) rename networks/local/{terradnode => core}/wrapper.sh (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index aca66821b..b53daf3c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -275,9 +275,9 @@ jobs: if [ -z "${TERRAD_VERSION}" ]; then docker build . else - docker build -t tendermint/terra:$TERRAD_VERSION . - # docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS - # docker push tendermint/terra:$TERRAD_VERSION + docker build -t terraproject/core:$TERRAD_VERSION . + docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS + docker push terraproject/core:$TERRAD_VERSION fi docker-tagged: @@ -289,9 +289,9 @@ jobs: - setup_remote_docker: docker_layer_caching: true - run: | - docker build -t tendermint/terra:$CIRCLE_TAG . - # docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS - # docker push tendermint/terra:$CIRCLE_TAG + docker build -t terraproject/core:$CIRCLE_TAG . + docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS + docker push terraproject/core:$CIRCLE_TAG reproducible-builds: executor: golang @@ -318,27 +318,6 @@ jobs: - store_artifacts: path: /go/src/github.com/terra-project/core/terra-windows-res.yml -# FIXME: The `setup-contract-tests-data` make target is broken as it completely -# overrides the .terrad directory. -# -# contract-tests: -# executor: golang -# steps: -# - attach_workspace: -# at: /tmp/workspace -# - checkout -# - setup_remote_docker: -# docker_layer_caching: true -# - run: -# name: Get Node.js and test REST implementation against swagger documentation at https://swagger.terra.money/rpc/ -# command: | -# go get github.com/snikch/goodman/cmd/goodman -# make build -# make build-contract-tests-hooks -# make setup-contract-tests-data -# export PATH=~/.local/bin:$PATH -# ./contrib/get_node.sh && make contract-tests - workflows: version: 2 test-suite: @@ -414,6 +393,3 @@ workflows: ignore: /.*/ tags: only: /v[0-9]+(\.[0-9]+)*(-.*)*/ -# - contract-tests: -# requires: -# - setup-dependencies diff --git a/Dockerfile b/Dockerfile index 24e5d49b7..6c3bd8fa5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # Simple usage with a mounted data directory: # > docker build -t terra . -# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init -# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start -# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init -# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start +# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init +# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start +# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init +# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start FROM golang:alpine AS build-env # Set up dependencies diff --git a/Makefile b/Makefile index 03a2d5249..75b73c215 100755 --- a/Makefile +++ b/Makefile @@ -169,36 +169,13 @@ build-docker-terradnode: # Run a 4-node testnet locally localnet-start: localnet-stop - @if ! [ -f build/node0/terrad/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/terrad:Z tendermint/terradnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi + @if ! [ -f build/node0/terrad/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/terrad:Z terraproject/core testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi docker-compose up -d # Stop testnet localnet-stop: docker-compose down -setup-contract-tests-data: - echo 'Prepare data for the contract tests' - rm -rf /tmp/contract_tests ; \ - mkdir /tmp/contract_tests ; \ - cp "${GOPATH}/pkg/mod/${CORE_PACK}/client/lcd/swagger-ui/swagger.yaml" /tmp/contract_tests/swagger.yaml ; \ - ./build/terrad init --home /tmp/contract_tests/.terrad --chain-id lcd contract-tests ; \ - tar -xzf lcd_test/testdata/state.tar.gz -C /tmp/contract_tests/ - -start-terra: setup-contract-tests-data - ./build/terrad --home /tmp/contract_tests/.terrad start & - @sleep 2s - -setup-transactions: start-terra - @bash ./lcd_test/testdata/setup.sh - -run-lcd-contract-tests: - @echo "Running Terra LCD for contract tests" - ./build/terracli rest-server --laddr tcp://0.0.0.0:8080 --home /tmp/contract_tests/.terracli --node http://localhost:26657 --chain-id lcd --trust-node true - -contract-tests: setup-transactions - @echo "Running Terra LCD for contract tests" - dredd && pkill terrad - # include simulations include sims.mk @@ -206,4 +183,3 @@ include sims.mk go-mod-cache draw-deps clean build \ setup-transactions setup-contract-tests-data start-terra run-lcd-contract-tests contract-tests \ test test-all test-build test-cover test-unit test-race - diff --git a/docker-compose.yml b/docker-compose.yml index af33a5557..2795fc49e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: terradnode0: container_name: terradnode0 - image: "tendermint/terradnode" + image: "terraproject/core" ports: - "26656-26657:26656-26657" environment: @@ -17,7 +17,7 @@ services: terradnode1: container_name: terradnode1 - image: "tendermint/terradnode" + image: "terraproject/core" ports: - "26659-26660:26656-26657" environment: @@ -31,7 +31,7 @@ services: terradnode2: container_name: terradnode2 - image: "tendermint/terradnode" + image: "terraproject/core" environment: - ID=2 - LOG=$${LOG:-terrad.log} @@ -45,7 +45,7 @@ services: terradnode3: container_name: terradnode3 - image: "tendermint/terradnode" + image: "terraproject/core" environment: - ID=3 - LOG=$${LOG:-terrad.log} diff --git a/networks/local/Makefile b/networks/local/Makefile index 630f7dc22..7beca135e 100644 --- a/networks/local/Makefile +++ b/networks/local/Makefile @@ -1,7 +1,7 @@ # Makefile for the "terradnode" docker image. all: - docker build --tag tendermint/terradnode terradnode + docker build --tag terraproject/core core .PHONY: all diff --git a/networks/local/terradnode/Dockerfile b/networks/local/core/Dockerfile similarity index 93% rename from networks/local/terradnode/Dockerfile rename to networks/local/core/Dockerfile index d891f8db4..3e05ed827 100644 --- a/networks/local/terradnode/Dockerfile +++ b/networks/local/core/Dockerfile @@ -5,7 +5,7 @@ RUN apk update && \ apk upgrade && \ apk --no-cache add curl jq file -VOLUME [ /terrad ] +VOLUME ["/terrad"] WORKDIR /terrad EXPOSE 26656 26657 ENTRYPOINT ["/usr/bin/wrapper.sh"] diff --git a/networks/local/terradnode/wrapper.sh b/networks/local/core/wrapper.sh similarity index 100% rename from networks/local/terradnode/wrapper.sh rename to networks/local/core/wrapper.sh