Skip to content

Commit bd796d6

Browse files
denis-yu-glotovpetermetz
authored andcommitted
feat: Add corda to CI (hyperledger-cacti#84)
* feature: add all scenarios to ci.sh, but travis runs only subset of them Signed-off-by: Denis Glotov <[email protected]> * fix: disable circle-ci Fabric deploy because Corda fills vm all resources and crashes if more processes comes in. `resource_class: large` would probably help so revert this patch when we have it available. Signed-off-by: Denis Glotov <[email protected]> * feature: add circle-ci badge to readme Signed-off-by: Denis Glotov <[email protected]>
1 parent 48d2536 commit bd796d6

File tree

5 files changed

+56
-57
lines changed

5 files changed

+56
-57
lines changed

.circleci/config.yml

+29-29
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
# GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2"
1010
machine:
1111
image: ubuntu-1604:201903-01
12-
resource_class: large
12+
# resource_class: large
1313
steps:
1414
- checkout # check out source code to working directory
1515
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
@@ -46,43 +46,43 @@ jobs:
4646
command: |
4747
cd packages/core/examples/simple-asset-transfer/
4848
npm run corda
49-
- run:
50-
name: Starting Fabric
51-
command: |
52-
source /opt/circleci/.nvm/nvm.sh
53-
cd packages/core/examples/simple-asset-transfer/
54-
npm install
55-
cd ./fabric/api/
56-
npm install
57-
cd ../../
58-
npm run fabric
49+
# - run:
50+
# name: Starting Fabric
51+
# command: |
52+
# source /opt/circleci/.nvm/nvm.sh
53+
# cd packages/core/examples/simple-asset-transfer/
54+
# npm install
55+
# cd ./fabric/api/
56+
# npm install
57+
# cd ../../
58+
# npm run fabric
5959

60-
- run:
61-
name: Build and federation networks
62-
command: |
63-
source /opt/circleci/.nvm/nvm.sh
64-
cd packages/core/examples/simple-asset-transfer/
65-
npm run fed:build
66-
npm run fed:corda
67-
npm run fed:fabric
60+
# - run:
61+
# name: Build and federation networks
62+
# command: |
63+
# source /opt/circleci/.nvm/nvm.sh
64+
# cd packages/core/examples/simple-asset-transfer/
65+
# npm run fed:build
66+
# npm run fed:corda
67+
# npm run fed:fabric
6868

69-
- run:
70-
name: Run scenarios
71-
command: |
72-
source /opt/circleci/.nvm/nvm.sh
73-
cd packages/core/examples/simple-asset-transfer/
74-
npm run scenario:share noquorum
75-
npm run scenario:CtF
76-
npm run scenario:FtC
69+
# - run:
70+
# name: Run scenarios
71+
# command: |
72+
# source /opt/circleci/.nvm/nvm.sh
73+
# cd packages/core/examples/simple-asset-transfer/
74+
# npm run scenario:share noquorum
75+
# npm run scenario:CtF
76+
# npm run scenario:FtC
7777

7878
- run:
7979
name: Stopping Corda
8080
command: |
8181
cd packages/core/examples/simple-asset-transfer/
8282
npm run fed:corda:down
83-
npm run fed:fabric:down
83+
# npm run fed:fabric:down
8484
npm run corda:down
85-
npm run fabric:down
85+
# npm run fabric:down
8686
8787
# Upload test results for display in Test Summary:
8888
# https://circleci.com/docs/2.0/collect-test-data/

.travis.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ dist: bionic
99
services:
1010
- docker
1111

12-
install:
13-
- docker --version
14-
- docker-compose --version
15-
1612
script:
17-
- ./packages/core/tools/ci.sh
13+
- CI_CONTAINERS_WAIT_TIME=12 CI_NO_CORDA=true ./packages/core/tools/ci.sh
1814

1915
after_script:
2016
- docker ps -a

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Hyperledger Labs Blockchain Integration Framework <!-- omit in toc -->
22

33
[![Build status]](https://travis-ci.org/hyperledger-labs/blockchain-integration-framework)
4+
[![CircleCI]](https://circleci.com/gh/hyperledger-labs/blockchain-integration-framework/tree/master)
45

56
[Build status]: https://travis-ci.org/hyperledger-labs/blockchain-integration-framework.svg?branch=master
7+
[CircleCI]: https://circleci.com/gh/hyperledger-labs/blockchain-integration-framework/tree/master.svg?style=svg
68

79
- [Short Description](#short-description)
810
- [Scope of Lab](#scope-of-lab)

packages/core/tools/ci.sh

+24-10
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function mainTask()
3131
docker-compose --version
3232
node --version
3333
npm --version
34-
java -version || true
34+
java -version
3535

3636
### COMMON
3737
cd $PKG_ROOT_DIR
@@ -47,6 +47,7 @@ function mainTask()
4747
cd $CI_ROOT_DIR
4848
npm run fed:quorum:down
4949
npm run fed:fabric:down
50+
npm run fed:corda:down
5051
npm run fabric:down
5152
npm run quorum:down
5253
npm run quorum:api:down
@@ -58,10 +59,9 @@ function mainTask()
5859
npm uninstall @hyperledger-labs/blockchain-integration-framework
5960
npm install @hyperledger-labs/blockchain-integration-framework@file:../../.tmp/hyperledger-labs-blockchain-integration-framework-dev.tgz
6061

61-
rm -rf fabric/api/fabric-client-kv-org*
62-
6362
### FABRIC
6463

64+
rm -rf fabric/api/fabric-client-kv-org*
6565
cd ./fabric/api/
6666
npm install
6767
cd ../../
@@ -82,7 +82,6 @@ function mainTask()
8282
npm run fed:build
8383
npm run fed:quorum
8484
npm run fed:fabric
85-
docker images
8685

8786
# If enough time have passed and there are still containers not ready then
8887
# just assume that they are in a crash loop and abort CI run.
@@ -94,23 +93,38 @@ function mainTask()
9493
iterationCount=$[$iterationCount +1]
9594
sleep 15; echo; date;
9695
done
97-
98-
docker ps -a
9996
sleep ${CI_CONTAINERS_WAIT_TIME:-120}
10097

10198
# Run scenarios and blockchain regression tests
102-
npm run scenario:share nocorda
99+
if [ -v CI_NO_CORDA ]; then
100+
npm run scenario:share nocorda
101+
else
102+
npm run corda:build
103+
npm run corda
104+
npm run fed:corda
105+
sleep ${CI_CONTAINERS_WAIT_TIME:-12}
106+
107+
# Run scenarios between Corda and Quorum
108+
npm run scenario:share
109+
npm run scenario:CtF
110+
npm run scenario:FtC
111+
npm run scenario:CtQ
112+
npm run scenario:QtC
113+
fi
103114
npm run scenario:QtF
104115
npm run scenario:FtQ
105116
npm run test:bc
106117

107118
dumpAllLogs
108119

120+
# Unloading Quorum staff to save resources for Corda
109121
npm run fed:quorum:down
122+
npm run fed:corda:down
110123
npm run fed:fabric:down
111-
npm run fabric:down
112-
npm run quorum:down
124+
npm run corda:down
113125
npm run quorum:api:down
126+
npm run quorum:down
127+
npm run fabric:down
114128
cd ../..
115129

116130
ENDED_AT=`date +%s`
@@ -136,7 +150,7 @@ function dumpAllLogs()
136150
set +eu # do not crash process upon individual command failures
137151
cd "$PKG_ROOT_DIR" # switch back to the original root dir because we don't
138152
# know where exactly the script crashed
139-
[ "$CI_NO_DUMP_ALL_LOGS" ] || ./tools/dump-all-logs.sh $CI_ROOT_DIR
153+
[ -v CI_NO_DUMP_ALL_LOGS ] || ./tools/dump-all-logs.sh $CI_ROOT_DIR
140154
cd -
141155
}
142156

packages/core/tools/cleanup.sh

-13
This file was deleted.

0 commit comments

Comments
 (0)