-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 1.0.5
- Loading branch information
Showing
25 changed files
with
600 additions
and
365 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/dev/tools/build_chain.sh && chmod u+x build_chain.sh | ||
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/ci/download_bin.sh) -b dev | ||
echo "127.0.0.1:4 agency1 1,2,3" > ipconf | ||
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0 | ||
./nodes/127.0.0.1/fisco-bcos -v | ||
./nodes/127.0.0.1/start_all.sh | ||
cp nodes/127.0.0.1/sdk/* src/main/resources/ | ||
mv src/main/resources/applicationContext-sample.xml src/main/resources/applicationContext.xml | ||
./gradlew verifyGoogleJavaFormat | ||
./gradlew build | ||
./gradlew test |
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,68 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
scan_code_script="python ~/cobra/cobra.py -t " | ||
ignore_files=(.ci) | ||
|
||
LOG_ERROR() { | ||
content=${1} | ||
echo -e "\033[31m${content}\033[0m" | ||
} | ||
|
||
LOG_INFO() { | ||
content=${1} | ||
echo -e "\033[32m${content}\033[0m" | ||
} | ||
|
||
execute_cmd() { | ||
command="${1}" | ||
eval ${command} | ||
ret=$? | ||
if [ $ret -ne 0 ];then | ||
LOG_ERROR "FAILED of command: ${command}" | ||
exit 1 | ||
else | ||
LOG_INFO "SUCCESS of command: ${command}" | ||
fi | ||
} | ||
|
||
should_ignore() | ||
{ | ||
local file=${1} | ||
for ignore in ${ignore_files[*]}; do | ||
if echo ${file} | grep ${ignore} &>/dev/null; then | ||
echo "ignore ${file} ${ignore}" | ||
return 0 | ||
fi | ||
done | ||
return 1 | ||
} | ||
|
||
scan_code() | ||
{ | ||
# Redirect output to stderr. | ||
exec 1>&2 | ||
for file in $(git diff-index --name-status HEAD^ | awk '{print $2}'); do | ||
if should_ignore ${file}; then continue; fi | ||
if [ ! -f ${file} ];then continue; fi | ||
LOG_INFO "check file ${file}" | ||
execute_cmd "${scan_code_script} $file -f json -o /tmp/report.json" | ||
trigger_rules=$(jq -r '.' /tmp/report.json | grep 'trigger_rules' | awk '{print $2}' | sed 's/,//g') | ||
echo "trigger_rules is ${trigger_rules}" | ||
rm /tmp/report.json | ||
if [ ${trigger_rules} -ne 0 ]; then | ||
echo "######### ERROR: Scan code failed, please adjust them before commit" | ||
exit 1 | ||
fi | ||
done | ||
} | ||
|
||
install_cobra() { | ||
git clone https://github.com/WhaleShark-Team/cobra.git ~/cobra | ||
pip install -r ~/cobra/requirements.txt | ||
cp ~/cobra/config.template ~/cobra/config | ||
} | ||
|
||
install_cobra | ||
scan_code |
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
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
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
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Thu Dec 14 17:23:14 GMT 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip |
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
Oops, something went wrong.