Merge pull request #91 from tomochain/feature/bootnodeimage

Add new pipeline for bootnode binary
This commit is contained in:
Tuna 2018-07-26 10:25:23 +07:00 committed by GitHub
commit f8074122af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 35 deletions

View file

@ -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

View file

@ -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"]

22
Dockerfile.bootnode Normal file
View file

@ -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"]

View file

@ -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."

View file

@ -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 "^<none>" | 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