diff --git a/.travis.yml b/.travis.yml index a9e0f9fda8..55482cea4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ jobs: - while sleep 540; do echo "[ still running ]"; done & - go run build/ci.go test -coverage - kill %1 - - stage: Build and push Docker image + - stage: Build and push tomochain/tomochain and tomochain/bootnode containers services: - docker before_install: @@ -49,7 +49,7 @@ jobs: script: bash docker_push.sh on: branch: master - - stage: Trigger rebuild of infrastructure image + - stage: Trigger rebuild of tomochain/infra-tomochain image sudo: false script: bash docker_rebuild.sh diff --git a/Dockerfile b/Dockerfile index 3d5a80c9f2..a366d0f309 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,6 @@ RUN chmod +x /usr/local/bin/tomo EXPOSE 8545 EXPOSE 30303 -ENTRYPOINT ["/usr/local/bin/tomo", "--help"] +ENTRYPOINT ["/usr/local/bin/tomo"] + +CMD ["--help"] diff --git a/Dockerfile.bootnode b/Dockerfile.bootnode new file mode 100644 index 0000000000..c9b19345b8 --- /dev/null +++ b/Dockerfile.bootnode @@ -0,0 +1,22 @@ +FROM golang:1.10-alpine as builder + +RUN apk add --no-cache make gcc musl-dev linux-headers + +ADD . /tomochain +RUN cd /tomochain && make bootnode + +FROM alpine:latest + +LABEL maintainer="etienne@tomochain.com" + +WORKDIR /tomochain + +COPY --from=builder /tomochain/build/bin/bootnode /usr/local/bin/bootnode + +RUN chmod +x /usr/local/bin/bootnode + +EXPOSE 30301 + +ENTRYPOINT ["/usr/local/bin/bootnode"] + +CMD ["--help"] diff --git a/Makefile b/Makefile index 4302b8ec40..6b3cc8a0e5 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,11 @@ tomo: @echo "Done building." @echo "Run \"$(GOBIN)/tomo\" to launch tomo." +bootnode: + build/env.sh go run build/ci.go install ./cmd/bootnode + @echo "Done building." + @echo "Run \"$(GOBIN)/bootnode\" to launch a bootnode." + swarm: build/env.sh go run build/ci.go install ./cmd/swarm @echo "Done building." diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 39ff5d83c6..0000000000 --- a/circle.yml +++ /dev/null @@ -1,32 +0,0 @@ -machine: - services: - - docker - -dependencies: - cache_directories: - - "~/.ethash" # Cache the ethash DAG generated by hive for consecutive builds - - "~/.docker" # Cache all docker images manually to avoid lengthy rebuilds - override: - # Restore all previously cached docker images - - mkdir -p ~/.docker - - for img in `ls ~/.docker`; do docker load -i ~/.docker/$img; done - - # Pull in and hive, restore cached ethash DAGs and do a dry run - - go get -u github.com/karalabe/hive - - (cd ~/.go_workspace/src/github.com/karalabe/hive && mkdir -p workspace/ethash/ ~/.ethash) - - (cd ~/.go_workspace/src/github.com/karalabe/hive && cp -r ~/.ethash/. workspace/ethash/) - - (cd ~/.go_workspace/src/github.com/karalabe/hive && hive --docker-noshell --client=NONE --test=. --sim=. --loglevel=6) - - # Cache all the docker images and the ethash DAGs - - for img in `docker images | grep -v "^" | tail -n +2 | awk '{print $1}'`; do docker save $img > ~/.docker/`echo $img | tr '/' ':'`.tar; done - - cp -r ~/.go_workspace/src/github.com/karalabe/hive/workspace/ethash/. ~/.ethash - -test: - override: - # Build Geth and move into a known folder - - make geth - - cp ./build/bin/geth $HOME/geth - - # Run hive and move all generated logs into the public artifacts folder - - (cd ~/.go_workspace/src/github.com/karalabe/hive && hive --docker-noshell --client=go-ethereum:local --override=$HOME/geth --test=. --sim=.) - - cp -r ~/.go_workspace/src/github.com/karalabe/hive/workspace/logs/* $CIRCLE_ARTIFACTS