From 91ba2f22a37cfdfc3425f463621354199d79e885 Mon Sep 17 00:00:00 2001 From: kyonRay Date: Sun, 28 Jan 2024 23:33:49 +0800 Subject: [PATCH 1/2] (script,ci): relax check restriction of openssl version 3.x, version to 1.4.0, update ci to check in jdk 8.0.382. --- .github/workflows/ci_check_bcos3.yml | 10 +++++++--- .github/workflows/ci_check_bcos_fabric.yml | 9 +++++++-- .github/workflows/ci_check_bcos_fabric2.yml | 9 +++++++-- .github/workflows/ci_check_cross_all.yml | 9 +++++++-- .github/workflows/ci_check_group_group.yml | 9 +++++++-- .github/workflows/ci_check_group_group_mac.yml | 7 ++++++- .github/workflows/ci_check_normal_gm.yml | 10 +++++++--- .github/workflows/ci_check_normal_gm_mac.yml | 7 ++++++- .github/workflows/ci_check_unittest.yml | 9 +++++---- .github/workflows/publish_binary.yml | 2 +- build.gradle | 2 +- demo/profile_version.sh | 16 ++++++++-------- release_note.txt | 2 +- scripts/build_wecross.sh | 2 +- scripts/create_cert.sh | 2 +- scripts/download_account_manager.sh | 2 +- scripts/download_console.sh | 2 +- scripts/download_demo.sh | 2 +- scripts/download_pages.sh | 2 +- scripts/download_plugin.sh | 8 ++++---- scripts/download_wecross.sh | 2 +- .../webank/wecross/common/WeCrossDefault.java | 2 +- 22 files changed, 82 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci_check_bcos3.yml b/.github/workflows/ci_check_bcos3.yml index 53917aa45..821de1580 100644 --- a/.github/workflows/ci_check_bcos3.yml +++ b/.github/workflows/ci_check_bcos3.yml @@ -14,15 +14,19 @@ jobs: with: mysql root password: '123456' - name: install dependencies - run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev default-jdk build-essential + run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev build-essential - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client mysql -u root --password=123456 -h 127.0.0.1 -P 3306 -e 'status;' mysql --host 127.0.0.1 --port 3306 -uroot -p123456 -e "SHOW DATABASES" - + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_cross_bcos3_demo_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash -x .ci/ci_cross_bcos3_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash -x .ci/ci_cross_bcos3_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' diff --git a/.github/workflows/ci_check_bcos_fabric.yml b/.github/workflows/ci_check_bcos_fabric.yml index 46e0d5116..5abd3441e 100644 --- a/.github/workflows/ci_check_bcos_fabric.yml +++ b/.github/workflows/ci_check_bcos_fabric.yml @@ -14,9 +14,14 @@ jobs: with: mysql root password: '123456' - name: install dependencies - run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev default-jdk build-essential + run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev build-essential + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_demo_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash .ci/ci_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash .ci/ci_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' diff --git a/.github/workflows/ci_check_bcos_fabric2.yml b/.github/workflows/ci_check_bcos_fabric2.yml index e65c7ecd7..3cde9f4d7 100644 --- a/.github/workflows/ci_check_bcos_fabric2.yml +++ b/.github/workflows/ci_check_bcos_fabric2.yml @@ -18,9 +18,14 @@ jobs: with: mysql root password: '123456' - name: install dependencies - run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev default-jdk build-essential + run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev build-essential + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_cross_fabric2_demo_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash .ci/ci_cross_fabric2_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash .ci/ci_cross_fabric2_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' diff --git a/.github/workflows/ci_check_cross_all.yml b/.github/workflows/ci_check_cross_all.yml index e9d7108e8..c3df1cd06 100644 --- a/.github/workflows/ci_check_cross_all.yml +++ b/.github/workflows/ci_check_cross_all.yml @@ -14,9 +14,14 @@ jobs: with: mysql root password: '123456' - name: install dependencies - run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev default-jdk build-essential + run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev build-essential + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_cross_all_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash -x .ci/ci_cross_all_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash -x .ci/ci_cross_all_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' diff --git a/.github/workflows/ci_check_group_group.yml b/.github/workflows/ci_check_group_group.yml index 407103948..d567cc841 100644 --- a/.github/workflows/ci_check_group_group.yml +++ b/.github/workflows/ci_check_group_group.yml @@ -14,9 +14,14 @@ jobs: with: mysql root password: '123456' - name: install dependencies - run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev default-jdk build-essential + run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev build-essential + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_cross_groups_demo_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash -x .ci/ci_cross_groups_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash -x .ci/ci_cross_groups_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' \ No newline at end of file diff --git a/.github/workflows/ci_check_group_group_mac.yml b/.github/workflows/ci_check_group_group_mac.yml index 7c14b8779..32ff7b91f 100644 --- a/.github/workflows/ci_check_group_group_mac.yml +++ b/.github/workflows/ci_check_group_group_mac.yml @@ -14,8 +14,13 @@ jobs: run: bash -x .ci/ci_mac_prepare.sh env: CI_DB_PASSWORD: '123456' + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_cross_groups_demo_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash -x .ci/ci_cross_groups_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash -x .ci/ci_cross_groups_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' \ No newline at end of file diff --git a/.github/workflows/ci_check_normal_gm.yml b/.github/workflows/ci_check_normal_gm.yml index 0505643b3..d2f7ce037 100644 --- a/.github/workflows/ci_check_normal_gm.yml +++ b/.github/workflows/ci_check_normal_gm.yml @@ -14,15 +14,19 @@ jobs: with: mysql root password: '123456' - name: install dependencies - run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev default-jdk build-essential + run: sudo apt-get update && sudo apt-get install -y mysql-client git curl libssl-dev build-essential - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client mysql -u root --password=123456 -h 127.0.0.1 -P 3306 -e 'status;' mysql --host 127.0.0.1 --port 3306 -uroot -p123456 -e "SHOW DATABASES" - + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_cross_gm_demo_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash -x .ci/ci_cross_gm_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash -x .ci/ci_cross_gm_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' diff --git a/.github/workflows/ci_check_normal_gm_mac.yml b/.github/workflows/ci_check_normal_gm_mac.yml index 1951a1531..946b7ba1c 100644 --- a/.github/workflows/ci_check_normal_gm_mac.yml +++ b/.github/workflows/ci_check_normal_gm_mac.yml @@ -22,8 +22,13 @@ jobs: run: | which openssl openssl version + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_cross_gm_demo_check.sh # The script only use ${1} as branch name. if GITHUB_BASE_REF is blank use GITHUB_REF - run: bash .ci/ci_cross_gm_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} + run: java -version && bash .ci/ci_cross_gm_demo_check.sh ${GITHUB_BASE_REF} ${GITHUB_REF#refs/heads/} env: CI_DB_PASSWORD : '123456' diff --git a/.github/workflows/ci_check_unittest.yml b/.github/workflows/ci_check_unittest.yml index ac48df713..18c9c0e4e 100644 --- a/.github/workflows/ci_check_unittest.yml +++ b/.github/workflows/ci_check_unittest.yml @@ -10,11 +10,12 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - name: Set up JDK 1.8.0.382 + uses: actions/setup-java@v3 with: - java-version: 1.8 + distribution: 'zulu' + java-version: '8.0.382' - name: run ci_check.sh - run: bash .ci/ci_check.sh + run: java -version && bash .ci/ci_check.sh - name: upload coverage run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/publish_binary.yml b/.github/workflows/publish_binary.yml index 9a1a21abf..1a1e693cf 100644 --- a/.github/workflows/publish_binary.yml +++ b/.github/workflows/publish_binary.yml @@ -25,7 +25,7 @@ jobs: - name: Build with Gradle run: ./gradlew assemble - name: Download plugin - run: cd dist/ && bash download_plugin.sh ALL v1.3.1 && bash download_pages.sh v1.3.1 && rm -rf src && cd - + run: cd dist/ && bash download_plugin.sh ALL v1.4.0 && bash download_pages.sh v1.4.0 && rm -rf src && cd - - name: Pack run: chmod +x dist/*.sh && mv dist WeCross && tar -zcvf WeCross.tar.gz WeCross - name: Checksum diff --git a/build.gradle b/build.gradle index 94670c37e..914eb27fe 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ repositories { } sourceCompatibility = '1.8' -version = '1.3.2-SNAPSHOT' +version = '1.4.0-SNAPSHOT' task stubSourceJar(type: Jar) { into 'com/webank/wecross/stub', { from 'src/main/java/com/webank/wecross/stub' } diff --git a/demo/profile_version.sh b/demo/profile_version.sh index 19e32f226..20e19e699 100644 --- a/demo/profile_version.sh +++ b/demo/profile_version.sh @@ -1,19 +1,19 @@ # WeCross -WECROSS_VERSION=v1.3.1 +WECROSS_VERSION=v1.4.0 # WeCross Console -WECROSS_CONSOLE_VERSION=v1.3.1 +WECROSS_CONSOLE_VERSION=v1.4.0 # WeCross Account Manager -WECROSS_ACCOUNT_MANAGER_VERSION=v1.3.1 +WECROSS_ACCOUNT_MANAGER_VERSION=v1.4.0 # WeCross BCOS2.0 Stub -WECROSS_BCOS2_STUB_VERSION=v1.3.1 +WECROSS_BCOS2_STUB_VERSION=v1.4.0 # WeCross BCOS3.0 Stub -WECROSS_BCOS3_STUB_VERSION=v1.3.1 +WECROSS_BCOS3_STUB_VERSION=v1.4.0 # WeCross Fabric1.4 Stub -WECROSS_FABRIC1_STUB_VERSION=v1.3.1 +WECROSS_FABRIC1_STUB_VERSION=v1.4.0 # WeCross Fabric2.0 Stub -WECROSS_FABRIC2_STUB_VERSION=v1.3.1 +WECROSS_FABRIC2_STUB_VERSION=v1.4.0 # WeCross Java SDK -WECROSS_JAVA_SDK_VERSION=v1.3.1 +WECROSS_JAVA_SDK_VERSION=v1.4.0 # FISCO BCOS BCOS_VERSION=v2.9.1 diff --git a/release_note.txt b/release_note.txt index 757407982..0d0c52f84 100644 --- a/release_note.txt +++ b/release_note.txt @@ -1 +1 @@ -v1.3.1 +v1.4.0 diff --git a/scripts/build_wecross.sh b/scripts/build_wecross.sh index 3d880f4f2..628b74178 100755 --- a/scripts/build_wecross.sh +++ b/scripts/build_wecross.sh @@ -53,7 +53,7 @@ EOF check_env() { # shellcheck disable=SC2143 # shellcheck disable=SC2236 - [ ! -z "$(openssl version | grep 1.0.2)" ] || [ ! -z "$(openssl version | grep 1.1)" ] || [ ! -z "$(openssl version | grep reSSL)" ] || { + [ ! -z "$(openssl version | grep 1.0.2)" ] || [ ! -z "$(openssl version | grep 1.1)" ] || [ ! -z "$(openssl version | grep 3.)" ] || [ ! -z "$(openssl version | grep reSSL)" ] || { LOG_ERROR "Please install openssl!" #echo "download openssl from https://www.openssl.org." LOG_INFO "Use \"openssl version\" command to check." diff --git a/scripts/create_cert.sh b/scripts/create_cert.sh index dcf9c82b8..cd8b296b9 100755 --- a/scripts/create_cert.sh +++ b/scripts/create_cert.sh @@ -49,7 +49,7 @@ LOG_FALT() { check_env() { # shellcheck disable=SC2143 # shellcheck disable=SC2236 - [ ! -z "$(openssl version | grep 1.0.2)" ] || [ ! -z "$(openssl version | grep 1.1)" ] || [ ! -z "$(openssl version | grep reSSL)" ] || { + [ ! -z "$(openssl version | grep 1.0.2)" ] || [ ! -z "$(openssl version | grep 1.1)" ] || [ ! -z "$(openssl version | grep 3.)" ] || [ ! -z "$(openssl version | grep reSSL)" ] || { LOG_ERROR "Please install openssl!" #echo "download openssl from https://www.openssl.org." LOG_INFO "Use \"openssl version\" command to check." diff --git a/scripts/download_account_manager.sh b/scripts/download_account_manager.sh index 41178e1b1..73abb60b6 100644 --- a/scripts/download_account_manager.sh +++ b/scripts/download_account_manager.sh @@ -3,7 +3,7 @@ set -e LANG=en_US.UTF-8 -default_compatibility_version=v1.3.1 # update this every release +default_compatibility_version=v1.4.0 # update this every release compatibility_version= enable_build_from_resource=0 diff --git a/scripts/download_console.sh b/scripts/download_console.sh index 05b7904d1..2d58107af 100644 --- a/scripts/download_console.sh +++ b/scripts/download_console.sh @@ -3,7 +3,7 @@ set -e LANG=en_US.UTF-8 -default_compatibility_version=v1.3.1 # update this every release +default_compatibility_version=v1.4.0 # update this every release BCOS_VERSION=v2.7.2 # use this version to specify get_account script compatibility_version= diff --git a/scripts/download_demo.sh b/scripts/download_demo.sh index 18e3aec00..834a34a9e 100644 --- a/scripts/download_demo.sh +++ b/scripts/download_demo.sh @@ -3,7 +3,7 @@ set -e LANG=en_US.UTF-8 -default_compatibility_version=v1.3.1 # update this every release +default_compatibility_version=v1.4.0 # update this every release compatibility_version= GIT_URL_BASE='github.com' diff --git a/scripts/download_pages.sh b/scripts/download_pages.sh index 4f301ce5d..019f69c4e 100644 --- a/scripts/download_pages.sh +++ b/scripts/download_pages.sh @@ -34,7 +34,7 @@ Usage: bash $0 : certain tag or branch to download e.g - bash $0 v1.3.1 + bash $0 v1.4.0 EOF exit 0 } diff --git a/scripts/download_plugin.sh b/scripts/download_plugin.sh index 75c0f2b39..e8d0319f0 100644 --- a/scripts/download_plugin.sh +++ b/scripts/download_plugin.sh @@ -50,10 +50,10 @@ Usage: : certain tag or branch to download e.g - bash $0 BCOS2 v1.3.1 - bash $0 BCOS3 v1.3.1 - bash $0 Fabric1 v1.3.1 - bash $0 Fabric2 v1.3.1 + bash $0 BCOS2 v1.4.0 + bash $0 BCOS3 v1.4.0 + bash $0 Fabric1 v1.4.0 + bash $0 Fabric2 v1.4.0 EOF exit 0 } diff --git a/scripts/download_wecross.sh b/scripts/download_wecross.sh index e91169c31..ffe1ac226 100755 --- a/scripts/download_wecross.sh +++ b/scripts/download_wecross.sh @@ -6,7 +6,7 @@ LANG=en_US.UTF-8 enable_build_from_resource=0 compatibility_version= -default_compatibility_version=v1.3.1 # update this every release +default_compatibility_version=v1.4.0 # update this every release deps_dir=$(pwd)'/WeCross/plugin/' pages_dir=$(pwd)'/WeCross/pages/' src_dir=$(pwd)'/src/' diff --git a/src/main/java/com/webank/wecross/common/WeCrossDefault.java b/src/main/java/com/webank/wecross/common/WeCrossDefault.java index d826fd5fb..ef69b6e0a 100644 --- a/src/main/java/com/webank/wecross/common/WeCrossDefault.java +++ b/src/main/java/com/webank/wecross/common/WeCrossDefault.java @@ -4,7 +4,7 @@ import java.util.List; public class WeCrossDefault { - public static final String VERSION = "v1.3.1"; + public static final String VERSION = "v1.4.0"; public static final String TEMPLATE_URL = "http://127.0.0.1:8080/"; From fdedc3d73fdecceeb51bc82bc465425a0ec0e977 Mon Sep 17 00:00:00 2001 From: kyonRay Date: Tue, 20 Feb 2024 10:34:34 +0800 Subject: [PATCH 2/2] (CI): add CI rare string test. --- .ci/check_rare_string.sh | 54 ++++++++++++++++++++++++ .ci/ci_cross_all_check.sh | 15 +++++++ .ci/ci_cross_bcos3_demo_check.sh | 15 +++++++ .ci/ci_cross_fabric2_demo_check.sh | 15 ++++++- .ci/ci_cross_gm_demo_check.sh | 13 ++++++ .ci/ci_demo_check.sh | 12 ++++++ .ci/gen_rare_string.sh | 67 ++++++++++++++++++++++++++++++ scripts/download_console.sh | 4 +- 8 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 .ci/check_rare_string.sh create mode 100644 .ci/gen_rare_string.sh diff --git a/.ci/check_rare_string.sh b/.ci/check_rare_string.sh new file mode 100644 index 000000000..fa2555b20 --- /dev/null +++ b/.ci/check_rare_string.sh @@ -0,0 +1,54 @@ +#!/bin/bash + + + +function LOG_ERROR() +{ + local content=${1} + echo -e "\033[31m"${content}"\033[0m" +} + +function LOG_INFO() +{ + local content=${1} + echo -e "\033[32m"${content}"\033[0m" +} + +get_md5sum_cmd() { + local md5sum_cmd="md5sum" + if [ "$(uname)" == "Darwin" ]; then + md5sum_cmd="md5" + fi + echo "$md5sum_cmd" +} + +function checkConcatenatedRareString() { + + concatenatedString=${1} + log_file=${2} + md5sum_cmd=$(get_md5sum_cmd) + + md5_concatenatedString=$(echo -n "$concatenatedString" | $md5sum_cmd | awk '{print $1}') + + # compare rare string and stringFromGet + get_output=$(cat ${log_file}| grep "result=" | awk -F '[][]' '{print $4}' | awk NF | tail -n 1) + md5_stringFromGet=$(echo -n "$get_output" | $md5sum_cmd | awk '{print $1}') + if [ "$md5_concatenatedString" != "$md5_stringFromGet" ]; then + LOG_ERROR "error: check failed, the md5 values of rareString and stringFromGet are not equal, fail concatenatedString: ${concatenatedString}, get_output: ${get_output}" + exit 1 + else + LOG_INFO "check success, concatenatedString: ${concatenatedString}" + fi +} + +main() { + concatenatedString=${1} + log_file=${2} + LOG_INFO "check rare string start, concatenatedString: ${concatenatedString}" + + checkConcatenatedRareString ${concatenatedString} ${log_file} + LOG_INFO "check rare string finished!" +} + +main "$@" + diff --git a/.ci/ci_cross_all_check.sh b/.ci/ci_cross_all_check.sh index 937bdc7c9..1a8390345 100644 --- a/.ci/ci_cross_all_check.sh +++ b/.ci/ci_cross_all_check.sh @@ -2,7 +2,9 @@ set -e ROOT=$(pwd)/demo/ +CI_PWD=$(pwd) PLUGIN_BRANCH=master +final_rare_input="" LOG_INFO() { local content=${1} @@ -14,6 +16,14 @@ LOG_ERROR() { echo -e "\033[31m[ERROR] ${content}\033[0m" } +prepare_rare_string() { + final_rare_input=$(bash ${CI_PWD}/.ci/gen_rare_string.sh) +} + +check_rare_string() { + bash ${CI_PWD}/.ci/check_rare_string.sh ${final_rare_input} ${ROOT}/WeCross-Console/logs/debug.log +} + check_log() { cd ${ROOT} error_log=routers-payment/127.0.0.1-8250-25500/logs/error.log @@ -62,6 +72,8 @@ demo_test() { ensure_bcos_nodes_running + prepare_rare_string + cd WeCross-Console/ bash start.sh <