forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
49 lines (43 loc) · 1.98 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
machine:
services:
- docker
environment:
IROHA_HOME: $(pwd)/iroha
PATH: $PATH:/opt/cmake-3.5.2-Linux-x86_64/bin
JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64/
java:
version: 'oraclejdk8'
dependencies:
cache_directories:
# to cache external dependencies
- ~/iroha/external
# to cache docker images
- ~/docker
override:
# one way to cache iroha-dev container is to save it to tar image. 2 mins vs 10 mins without caching.
- if [[ -e ~/docker/iroha-dev.tar ]]; then docker load -i ~/docker/iroha-dev.tar; else docker build --rm=false -t hyperledger/iroha-dev ${IROHA_HOME}/docker/dev; fi
# build iroha. Result of this instruction is ${IROHA_HOME}/docker/build/iroha.tar
- docker run -i -v ${IROHA_HOME}/docker/build:/build -v ${IROHA_HOME}:/opt/iroha hyperledger/iroha-dev sh <<< "cd /opt/iroha; /build-iroha.sh Release || exit 2; /mktar-iroha.sh || exit 3; cp /tmp/iroha.tar /build/iroha.tar || exit 4"
# build iroha-docker image
- docker build --rm=false -t hyperledger/iroha-docker ${IROHA_HOME}/docker/build
# cache iroha-dev image. takes 30 sec to save into file
- mkdir -p ~/docker; docker save hyperledger/iroha-dev > ~/docker/iroha-dev.tar
test:
pre:
# TESTS:
# first, run ctest inside a container
- docker run -p 1204:1204 hyperledger/iroha-docker /test.sh
# then, run iroha with dummy config (1 node) and print its output to stdout
- docker logs $(docker run -it -d -p 1204:1204 hyperledger/iroha-docker /run.sh)
# put new tests below
#- curl -X POST http://127.0.0.1:1204/account/register -d '{"publicKey":"WdvM/DPabapmtA7ISbTYPywbHxk8gWu2221LzmcmAgw=","alias":"yonezu","timestamp":1482053586}'
deployment:
hub:
branch: master
commands:
# makes docker login and docker push $1
- ${IROHA_HOME}/deploy.sh hyperledger/iroha-docker
branch: develop
commands:
# makes docker login and docker push $1
- ${IROHA_HOME}/deploy.sh hyperledger/iroha-docker-develop