mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Adds the apps and chaincodes to linting and testing CI that weren't added before. Linting issues were corrected where necessary to make CI pass. The Basic-Go application and Private-Javascript application are currently disabled pending fixes currently being worked on. Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
52 lines
1.1 KiB
Bash
Executable file
52 lines
1.1 KiB
Bash
Executable file
set -euo pipefail
|
|
|
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
|
CHAINCODE_NAME=${CHAINCODE_NAME:-basic}
|
|
|
|
function print() {
|
|
GREEN='\033[0;32m'
|
|
NC='\033[0m'
|
|
echo
|
|
echo -e "${GREEN}${1}${NC}"
|
|
}
|
|
|
|
function createNetwork() {
|
|
print "Creating network"
|
|
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
|
print "Deploying ${CHAINCODE_NAME} chaincode"
|
|
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}"
|
|
}
|
|
|
|
function stopNetwork() {
|
|
print "Stopping network"
|
|
./network.sh down
|
|
}
|
|
|
|
# Run Go application
|
|
#createNetwork
|
|
#print "Initializing Go application"
|
|
#pushd ../asset-transfer-basic/application-go
|
|
#print "Executing AssetTransfer.go"
|
|
#go run .
|
|
#popd
|
|
#stopNetwork
|
|
|
|
# Run Java application
|
|
createNetwork
|
|
print "Initializing Java application"
|
|
pushd ../asset-transfer-basic/application-java
|
|
print "Executing Gradle Run"
|
|
gradle run
|
|
popd
|
|
stopNetwork
|
|
|
|
# Run Javascript application
|
|
createNetwork
|
|
print "Initializing Javascript application"
|
|
pushd ../asset-transfer-basic/application-javascript
|
|
npm install
|
|
print "Executing app.js"
|
|
node app.js
|
|
popd
|
|
stopNetwork
|