diff --git a/build.sh b/build.sh index 0bec869eb6714968f5234927a0895e43e7dcb6ad..43153643c9c5453b3ea17d622618372c535fd671 100644 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ set -e current_dir=$(cd $(dirname "$0"); pwd) -tag="v0.1" +tag="v0.2" mkdir -p "${current_dir}"/build diff --git a/component/build_component.sh b/component/build_component.sh index 74c82c360ef39c5016b3fc0aed7c195084056af4..52235f876e3aa952a0859ae91c1e16b887640925 100644 --- a/component/build_component.sh +++ b/component/build_component.sh @@ -13,16 +13,15 @@ umask 077 function build_lkp_tests() { # 单独处理LkpTests mkdir -p "${final_component_dir}"/LkpTests - bash "${current_dir}"/LkpTests/build_lkp_tests_all.sh "${final_component_dir}"/LkpTests - - if [[ "$?" -ne "0" ]]; then - exit 1 - fi cp -rf "${current_dir}"/LkpTests/install.sh "${final_component_dir}"/LkpTests cp -rf "${current_dir}"/LkpTests/check_install_result.sh "${final_component_dir}"/LkpTests } +function build_devkit_distribute() { + bash "${current_dir}"/DevkitDistribute/build_devkit_distribute.sh +} + function main() { if [[ -d ${final_component_dir} ]]; then rm -rf "${final_component_dir}" @@ -31,15 +30,14 @@ function main() { mkdir -p "${final_component_dir}" component_arrays=( - "BiShengCompiler" "BiShengJDK8" "BiShengJDK17" "GCCforOpenEuler" "OpenEulerMirrorISO" "CompatibilityTesting" "CloudTest" + "BiShengCompiler" "BiShengJDK8" "BiShengJDK17" "GCCforOpenEuler" "OpenEulerMirrorISO" "CompatibilityTesting" ) for element in "${component_arrays[@]}"; do cp -rf "${current_dir}/${element}" "${final_component_dir}" done build_lkp_tests - - bash "${current_dir}"/DevkitDistribute/build_devkit_distribute.sh + build_devkit_distribute } main "$@" diff --git a/tools/download_dependency/build_download.sh b/tools/download_dependency/build_download.sh index 500aabdf9ee88cdcab58099a1d3c4e814ad192e5..0d00fc0ebb67f41aaf923e024587f802847dc2c6 100644 --- a/tools/download_dependency/build_download.sh +++ b/tools/download_dependency/build_download.sh @@ -14,6 +14,4 @@ mkdir -p "${build_dir}" cd "${build_dir}" -pyinstaller -F "${current_dir}"/src/download.py -p "${current_dir}"/src \ - --add-data "../../tools/download_dependency/lkp_help:lkp_help" \ - --add-data "../../tools/download_dependency/compatibility_test_help:compatibility_test_help" +pyinstaller -F "${current_dir}"/src/download.py -p "${current_dir}"/src diff --git a/tools/download_dependency/src/download.py b/tools/download_dependency/src/download.py index 7586f9bc29446db89f377c8507c3a4163e75b7c9..eab41a3fce8e63e9e796f3ab8aa2260b9b1ea492 100644 --- a/tools/download_dependency/src/download.py +++ b/tools/download_dependency/src/download.py @@ -6,7 +6,7 @@ import shutil import tarfile import time import download_config -from download_utils import download_dependence_handler, download_dependence_file, base_path +from download_utils import download_dependence_handler, download_dependence_file from download_command_line import process_command_line, CommandLine FILE = "file" @@ -36,6 +36,25 @@ component_collection_map = { ) } +lkp_collection_map = { + "LkpTests": { + "download file": { + URL: f"{download_config.LkpTests.get(FILE)}", + SAVE_PATH: f"{os.path.join(DEFAULT_PATH, 'lkp-tests.tar.gz')}", + }, + "download gem dependency": { + URL: f"{download_config.LkpTests.get('gem dependency')}", + SAVE_PATH: f"{os.path.join(DEFAULT_PATH, 'gem_dependencies.zip')}", + }, + }, + "CompatibilityTesting": { + "download file": { + URL: f"{download_config.CompatibilityTesting.get(FILE)}", + SAVE_PATH: f"{os.path.join(DEFAULT_PATH, 'compatibility_testing.tar.gz')}", + } + }, +} + def download_dependence(): if not os.path.exists(DEFAULT_PATH): @@ -47,6 +66,7 @@ def download_dependence(): pass ret = True + component_collection_map.update(lkp_collection_map) for component_name in component_collection_map: shell_dict = component_collection_map.get(component_name) ret = ret and download_dependence_handler(shell_dict) diff --git a/tools/download_dependency/src/download_config.py b/tools/download_dependency/src/download_config.py index 6bda486895633177196a279de5534df229eeac65..9d4d3b524c166b330a2ac3cccf447ed1d02910de 100644 --- a/tools/download_dependency/src/download_config.py +++ b/tools/download_dependency/src/download_config.py @@ -20,6 +20,22 @@ BiShengJDK17 = { } +LkpTests = { + "component_name": "LkpTests", + "file": "https://gitee.com/openeuler/devkit-pipeline/releases/download/v0.2/lkp-tests.tar.gz", + "gem dependency": "https://gitee.com/openeuler/devkit-pipeline/releases/download/v0.2/gem_dependencies.zip", +} + +CompatibilityTesting = { + "component_name": "CompatibilityTesting", + "file": "https://gitee.com/openeuler/devkit-pipeline/releases/download/v0.2/compatibility_testing.tar.gz", +} + +DevkitDistribute = { + "component_name": "DevkitDistribute", + "file": "https://gitee.com/openeuler/devkit-pipeline/releases/download/v0.2/devkit_distribute.tar.gz", +} + OpenEuler_2003_LTS = { "component_name": "openEuler_2003_LTS", "file": "https://mirrors.huaweicloud.com/openeuler/openEuler-20.03-LTS/ISO/aarch64/openEuler-20.03-LTS-everything-aarch64-dvd.iso", diff --git a/tools/download_dependency/src/download_utils.py b/tools/download_dependency/src/download_utils.py index 85aeda3241ccbb93354873dfd86aa0f6d2b39a1a..6f422176b0b2f382f1f478f357521a2a4668f69c 100644 --- a/tools/download_dependency/src/download_utils.py +++ b/tools/download_dependency/src/download_utils.py @@ -35,10 +35,3 @@ def download_dependence_file(shell_cmd, shell_dict): ret = False return ret - -def base_path(path): - if getattr(sys, 'frozen', False): - base_dir = sys._MEIPASS - else: - base_dir = os.path.dirname(__file__) - return os.path.join(base_dir, path) diff --git a/tools/install_dependency/src/handler/gather_package.py b/tools/install_dependency/src/handler/gather_package.py index a5f469197359f28793f35372f611f87d4f5c8cce..edaed4e79e8cb48b8657e353bbb4a19cc0dcc6dd 100644 --- a/tools/install_dependency/src/handler/gather_package.py +++ b/tools/install_dependency/src/handler/gather_package.py @@ -2,7 +2,7 @@ import logging import os import subprocess import constant -from download import download_dependence, component_collection_map +from download import download_dependence, component_collection_map, lkp_collection_map from handler.handler_and_node import Handler LOGGER = logging.getLogger("install_dependency") @@ -60,6 +60,7 @@ class GatherPackage(Handler): if not os.path.isdir(constant.DEPENDENCY_DIR): LOGGER.warning(f"The directory {constant.DEPENDENCY_DIR} not exists.") return False + component_collection_map.update(lkp_collection_map) for component_name in component_collection_map: shell_dict = component_collection_map.get(component_name) for shell_cmd in shell_dict: diff --git a/tools/install_dependency/src/lkp_collect_map.py b/tools/install_dependency/src/lkp_collect_map.py index 040265eac12d248e2034b2771a305818017970c6..2303e2c1f6b2d3e14cbb0f2f8bbace1bdac5fb92 100644 --- a/tools/install_dependency/src/lkp_collect_map.py +++ b/tools/install_dependency/src/lkp_collect_map.py @@ -2,18 +2,20 @@ import os.path from utils import base_path +CURRENT_DEFAULT_PATH = "./devkitdependencies" + lkp_collection_map = { "LkpTests": { "download file": { - "save_path": f"{os.path.join(base_path('component'), 'LkpTests', 'lkp-tests.tar.gz')}", + "save_path": f"{os.path.join(CURRENT_DEFAULT_PATH, 'lkp-tests.tar.gz')}", }, "download gem dependency": { - "save_path": f"{os.path.join(base_path('component'), 'LkpTests', 'gem_dependencies.zip')}", + "save_path": f"{os.path.join(CURRENT_DEFAULT_PATH, 'gem_dependencies.zip')}", }, }, "CompatibilityTesting": { "download file": { - "save_path": f"{os.path.join(base_path('component'), 'LkpTests', 'compatibility_testing.tar.gz')}", + "save_path": f"{os.path.join(CURRENT_DEFAULT_PATH, 'compatibility_testing.tar.gz')}", } }, "DevkitDistribute": {