mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 17:45:10 +00:00
Merge "[FAB-16147] Compilation and Lint Checks" into release-1.4
This commit is contained in:
commit
d26e27e0d1
13 changed files with 9617 additions and 47 deletions
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
|
|
@ -136,6 +136,27 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Run Commercial Paper tests
|
||||||
|
stage('Run Commercial Paper Tests') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
// making the output color coded
|
||||||
|
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
|
||||||
|
try {
|
||||||
|
dir("$ROOTDIR/$BASE_DIR/scripts/ci_scripts") {
|
||||||
|
// Run fabcar tests
|
||||||
|
sh './ciScript.sh --commercialpaper_Tests'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
failure_stage = "commercialpaper_Tests"
|
||||||
|
currentBuild.result = 'FAILURE'
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} // stages
|
} // stages
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
|
|
||||||
4
chaincode/chaincode_example02/java/.gitignore
vendored
Normal file
4
chaincode/chaincode_example02/java/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
bin/
|
||||||
|
.classpath
|
||||||
|
.settings/
|
||||||
|
.gradle
|
||||||
17
commercial-paper/.build/makefile
Normal file
17
commercial-paper/.build/makefile
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
.PHONY: all
|
||||||
|
|
||||||
|
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
|
all: digibank magnetocorp
|
||||||
|
|
||||||
|
digibank:
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/application-java; mvn clean compile package
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/contract-java; ./gradlew clean build shadowJar
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/application; npm install && npm run lint
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/contract; npm install && npm run lint
|
||||||
|
|
||||||
|
magnetocorp:
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/application-java; mvn clean compile package
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/contract-java; ./gradlew clean build shadowJar
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/application; npm install && npm run lint
|
||||||
|
cd ${ROOT_DIR}/../organization/$@/contract; npm install && npm run lint
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "buy.js",
|
"main": "buy.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
"test": "rm -rf _idwallet && node addToWallet.js && node buy.js"
|
"test": "rm -rf _idwallet && node addToWallet.js && node buy.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ async function main() {
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
// Disconnect from the gateway
|
// Disconnect from the gateway
|
||||||
console.log('Disconnect from Fabric gateway.')
|
console.log('Disconnect from Fabric gateway.');
|
||||||
gateway.disconnect();
|
gateway.disconnect();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
.gradle/
|
.gradle/
|
||||||
build/
|
build/
|
||||||
bin/
|
bin/
|
||||||
|
.classpath
|
||||||
|
.settings/
|
||||||
|
|
@ -74,7 +74,7 @@ public class CommercialPaperContract implements ContractInterface {
|
||||||
|
|
||||||
// create an instance of the paper
|
// create an instance of the paper
|
||||||
CommercialPaper paper = CommercialPaper.createInstance(issuer, paperNumber, issueDateTime, maturityDateTime,
|
CommercialPaper paper = CommercialPaper.createInstance(issuer, paperNumber, issueDateTime, maturityDateTime,
|
||||||
faceValue,"");
|
faceValue,issuer,"");
|
||||||
|
|
||||||
// Smart contract, rather than paper, moves paper into ISSUED state
|
// Smart contract, rather than paper, moves paper into ISSUED state
|
||||||
paper.setIssued();
|
paper.setIssued();
|
||||||
|
|
|
||||||
1
commercial-paper/organization/digibank/contract/.gitignore
vendored
Normal file
1
commercial-paper/organization/digibank/contract/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules/
|
||||||
4755
commercial-paper/organization/digibank/contract/package-lock.json
generated
Normal file
4755
commercial-paper/organization/digibank/contract/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -4,6 +4,7 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "issue.js",
|
"main": "issue.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
"test": "rm -rf _idwallet && node addToWallet.js && node issue.js"
|
"test": "rm -rf _idwallet && node addToWallet.js && node issue.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|
|
||||||
1
commercial-paper/organization/magnetocorp/contract/.gitignore
vendored
Normal file
1
commercial-paper/organization/magnetocorp/contract/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules/
|
||||||
4755
commercial-paper/organization/magnetocorp/contract/package-lock.json
generated
Normal file
4755
commercial-paper/organization/magnetocorp/contract/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -30,6 +30,9 @@ Parse_Arguments() {
|
||||||
--fabcar_Tests)
|
--fabcar_Tests)
|
||||||
fabcar_Tests
|
fabcar_Tests
|
||||||
;;
|
;;
|
||||||
|
--commercialpaper_Tests)
|
||||||
|
commercialpaper_Tests
|
||||||
|
;;
|
||||||
--pull_Thirdparty_Images)
|
--pull_Thirdparty_Images)
|
||||||
pull_Thirdparty_Images
|
pull_Thirdparty_Images
|
||||||
;;
|
;;
|
||||||
|
|
@ -139,5 +142,14 @@ fabcar_Tests() {
|
||||||
echo "node version ------> $(node -v)"
|
echo "node version ------> $(node -v)"
|
||||||
echo "-----------> Execute FabCar Tests"
|
echo "-----------> Execute FabCar Tests"
|
||||||
./fabcar.sh
|
./fabcar.sh
|
||||||
|
echo "Also running the compilation and lint tests of CommercialPaper"
|
||||||
|
make -f ../../commercial-paper/.build/makefile
|
||||||
|
}
|
||||||
|
|
||||||
|
# run commercial paper tests
|
||||||
|
commercialpaper_Tests() {
|
||||||
|
echo
|
||||||
|
echo "-----------> Execute Commercial Paper Tests"
|
||||||
|
make -f ../../commercial-paper/.build/makefile
|
||||||
}
|
}
|
||||||
Parse_Arguments $@
|
Parse_Arguments $@
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue