-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FABN-1184] Add CI script for fabtoken sample app
Change-Id: I611d9249c177a8bbc7e36d0406b81eb8e69dfa3e Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
- Loading branch information
1 parent
fdf88df
commit 5056a23
Showing
4 changed files
with
90 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# docker container list - Check these from basic-network/docker-compose.yaml | ||
CONTAINER_LIST=(peer0.org1 orderer ca) | ||
|
||
logs() { | ||
|
||
for CONTAINER in ${CONTAINER_LIST[*]}; do | ||
docker logs $CONTAINER.example.com >& $WORKSPACE/$CONTAINER-$1.log | ||
echo | ||
done | ||
# Write couchdb container logs into couchdb.log file | ||
docker logs couchdb >& couchdb.log | ||
|
||
} | ||
|
||
copy_logs() { | ||
|
||
# Call logs function | ||
logs $2 $3 | ||
|
||
if [ $1 != 0 ]; then | ||
echo -e "\033[31m $2 test case is FAILED" "\033[0m" | ||
exit 1 | ||
fi | ||
} | ||
|
||
cd $WORKSPACE/$BASE_DIR/fabtoken || exit | ||
export PATH=gopath/src/github.com/hyperledger/fabric-samples/bin:$PATH | ||
|
||
LANGUAGE="javascript" | ||
|
||
echo -e "\033[32m starting fabtoken test (${LANGUAGE})" "\033[0m" | ||
./startFabric.sh | ||
copy_logs $? fabtoken-start-script-${LANGUAGE} | ||
|
||
pushd ${LANGUAGE} | ||
npm install | ||
node fabtoken.js | ||
copy_logs $? fabtoken-${LANGUAGE} | ||
popd | ||
|
||
docker ps -aq | xargs docker rm -f | ||
docker rmi -f $(docker images -aq dev-*) | ||
echo -e "\033[32m finished fabtoken tests (${LANGUAGE})" "\033[0m" |