forked from ubiq/go-ubiq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
32 lines (27 loc) · 1.52 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
machine:
services:
- docker
dependencies:
cache_directories:
- "~/.ubqhash" # Cache the ubqhash 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 ubqhash DAGs and do a dry run
- go get -u github.com/karalabe/hive
- (cd ~/.go_workspace/src/github.com/karalabe/hive && mkdir -p workspace/ubqhash/ ~/.ubqhash)
- (cd ~/.go_workspace/src/github.com/karalabe/hive && cp -r ~/.ubqhash/. workspace/ubqhash/)
- (cd ~/.go_workspace/src/github.com/karalabe/hive && hive --docker-noshell --client=NONE --test=. --sim=. --loglevel=6)
# Cache all the docker images and the ubqhash 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/ubqhash/. ~/.ubqhash
test:
override:
# Build Gubiq and move into a known folder
- make gubiq
- cp ./build/bin/gubiq $HOME/gubiq
# 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-ubiq:local --override=$HOME/gubiq --test=. --sim=.)
- cp -r ~/.go_workspace/src/github.com/karalabe/hive/workspace/logs/* $CIRCLE_ARTIFACTS