From 3356aa7b8d6dd8afc0cb92ef987ef95d8ff71299 Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 07:59:17 +0000 Subject: [PATCH 1/9] update tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/jenkins_generator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py index d976d74..8518a6c 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py @@ -543,12 +543,13 @@ pipeline { steps { script{ sh ''' - CURDIR=$(pwd) + rm -rf ./report_dir + mkdir ./report_dir cp -rf ${HOME}/.local/compatibility_testing/template.html.bak ${HOME}/.local/compatibility_testing/template.html ${HOME}/.local/compatibility_testing/bin/compatibility_test - cp -rf ${HOME}/.local/compatibility_testing/compatibility_report.html $CURDIR + cp -rf ${HOME}/.local/compatibility_testing/compatibility_report.html ./report_dir ''' - sh(script: "sudo bash ${HOME}/.local/compatibility_testing/report_result.sh", returnStdout:true).trim() + sh(script: "${HOME}/.local/compatibility_testing/report_result.sh", returnStdout:true).trim() } } post { -- Gitee From 9fd3a9bda77b7a3d28c27b29f39ce98e76fbc8a2 Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:05:43 +0000 Subject: [PATCH 2/9] update tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/gitlab_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py index 3149a39..2746a87 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py @@ -231,7 +231,7 @@ compatibility_test: # This job runs in the build stage, which runs first. - cp -rf ${HOME}/.local/compatibility_testing/template.html.bak ${HOME}/.local/compatibility_testing/template.html - ${HOME}/.local/compatibility_testing/bin/compatibility_test - cp -rf ${HOME}/.local/compatibility_testing/compatibility_report.html $CURDIR/compatibility_report.html - - sudo /bin/bash ${HOME}/.local/compatibility_testing/report_result.sh + - sh ${HOME}/.local/compatibility_testing/report_result.sh - echo "请去 '${CURDIR}'/compatibility_report.html 查看报告 " artifacts: paths: -- Gitee From 4bfcb0f95b4e2a542de40f37cbc373158ebd34c5 Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:06:15 +0000 Subject: [PATCH 3/9] update tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/jenkins_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py index 8518a6c..c039465 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py @@ -549,7 +549,7 @@ pipeline { ${HOME}/.local/compatibility_testing/bin/compatibility_test cp -rf ${HOME}/.local/compatibility_testing/compatibility_report.html ./report_dir ''' - sh(script: "${HOME}/.local/compatibility_testing/report_result.sh", returnStdout:true).trim() + sh(script: "sh ${HOME}/.local/compatibility_testing/report_result.sh", returnStdout:true).trim() } } post { -- Gitee From e39ca9ba40be3e096a11d138598e6842c2c8fc6d Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:28:08 +0000 Subject: [PATCH 4/9] update tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../jenkins_generator.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py index c039465..102993b 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py @@ -449,16 +449,16 @@ pipeline { } """ java17_build_template = """ - // 普通编译 - stage('java17-build') { - agent { - label 'kunpeng_java_builder_jdk17' - } - steps { - get_code("${GIT_BRANCH}", "${GIT_TARGET_DIR_NAME}", "${GIT_URL}") - sh "${BUILD_COMMAND}" - } - } + // 普通编译 + stage('java17-build') { + agent { + label 'kunpeng_java_builder_jdk17' + } + steps { + get_code("${GIT_BRANCH}", "${GIT_TARGET_DIR_NAME}", "${GIT_URL}") + sh "${BUILD_COMMAND}" + } + } """ gcc_template = """ // 普通编译 -- Gitee From 5dfdb12386864ca37b46ca28bc02f47c23062581 Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:32:54 +0000 Subject: [PATCH 5/9] update tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/jenkins_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py index 102993b..03b470a 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py @@ -517,7 +517,7 @@ pipeline { # 删除上次jmeter产生的报告 (jmeter 命令-l、-o指定的文件和路径) rm -rf "${JAVA_JMETER_RESULT_FILE_NAME}" "${JAVA_JMETER_RESULT_REPORT_DIR}" # 运行java性能采集 - ${HOME}/.local/devkit_tester/bin/entrance -i "${TARGET_SERVER_IP}" -u root -f ${HOME}/.ssh/id_rsa -D "${DEVKIT_WEB_IP}" -a "${JAVA_APPLICATION_NAME}" -d "${JAVA_COLLECTION_APPLICATION_DURATION}" -g "./${GIT_TARGET_DIR_NAME}" -j 'sh "${JAVA_JMETER_COMMAND}"' -o ./report_dir + ${HOME}/.local/devkit_tester/bin/entrance -i "${JAVA_TARGET_SERVER_IP}" -u root -f ${HOME}/.ssh/id_rsa -D "${DEVKIT_WEB_IP}" -a "${JAVA_APPLICATION_NAME}" -d "${JAVA_COLLECTION_APPLICATION_DURATION}" -g "./${GIT_TARGET_DIR_NAME}" -j 'sh "${JAVA_JMETER_COMMAND}"' -o ./report_dir ''' } post { -- Gitee From 40318b82f4e4fd1681318fef6900d3d9b3d2b6ce Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:33:22 +0000 Subject: [PATCH 6/9] update tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/gitlab_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py index 2746a87..9e798a9 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py @@ -213,7 +213,7 @@ java-performance-analysis: # 删除上次jmeter产生的报告 (jmeter 命令-l、-o指定的文件和路径) - rm -rf ${JAVA_JMETER_RESULT_FILE_NAME} ${JAVA_JMETER_RESULT_REPORT_DIR} # 运行java性能采集 - - ${HOME}/.local/devkit_tester/bin/entrance -i ${TARGET_SERVER_IP} -u root -f ${HOME}/.ssh/id_rsa -D ${DEVKIT_WEB_IP} -a ${JAVA_APPLICATION_NAME} -d ${JAVA_COLLECTION_APPLICATION_DURATION} -g ./${GIT_TARGET_DIR_NAME} -j 'sh ${JAVA_JMETER_COMMAND}' -o ./ + - ${HOME}/.local/devkit_tester/bin/entrance -i ${JAVA_TARGET_SERVER_IP} -u root -f ${HOME}/.ssh/id_rsa -D ${DEVKIT_WEB_IP} -a ${JAVA_APPLICATION_NAME} -d ${JAVA_COLLECTION_APPLICATION_DURATION} -g ./${GIT_TARGET_DIR_NAME} -j 'sh ${JAVA_JMETER_COMMAND}' -o ./ artifacts: paths: - devkit_performance_report.html -- Gitee From 3895a62d3b5826f6ef467162644511b636238e82 Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:41:36 +0000 Subject: [PATCH 7/9] update tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/gitlab_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py index 9e798a9..34e4c4f 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/gitlab_generator.py @@ -49,7 +49,7 @@ variables: # 需要采集的应用名称,多个采用逗号隔离 JAVA_APPLICATION_NAME: "" # 采集目标应用时间,单位秒。当存在-j参数时,jmeter结束或者到达采集执行时间,结束采集 - JAVA_COLLECTION_APPLICATION_DURATION: "" + JAVA_COLLECTION_APPLICATION_DURATION: 10 # jmeter执行命令。例如:bash /opt/apache-jmeter-5.6.3/bin/jmeter.sh -nt /home/xxx/Request.jmx -l /home/xxx/result.html -eo /home/xxx/report JAVA_JMETER_COMMAND: "" # jmeter -l参数,将测试结果以指定的文件名保存到本地 -- Gitee From f62d7fd795f651aa0cd6e18f7e0a53e36657519d Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:42:00 +0000 Subject: [PATCH 8/9] update tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/jenkins_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py index 03b470a..ed155af 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py @@ -62,7 +62,7 @@ pipeline { // 需要采集的应用名称,多个采用逗号隔离 JAVA_APPLICATION_NAME = "" // 采集目标应用时间,单位秒。当存在-j参数时,jmeter结束或者到达采集执行时间,结束采集 - JAVA_COLLECTION_APPLICATION_DURATION = "" + JAVA_COLLECTION_APPLICATION_DURATION = 10 // jmeter执行命令。例如:bash /opt/apache-jmeter-5.6.3/bin/jmeter.sh -nt /home/xxx/Request.jmx -l /home/xxx/result.html -eo /home/xxx/report JAVA_JMETER_COMMAND = "" // jmeter -l参数,将测试结果以指定的文件名保存到本地 -- Gitee From e03ee8433ee5470131cfac3b59ffa803c3031bff Mon Sep 17 00:00:00 2001 From: openeuler <2965713873@qq.com> Date: Sat, 15 Jun 2024 08:55:38 +0000 Subject: [PATCH 9/9] update tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py. Signed-off-by: openeuler <2965713873@qq.com> --- .../src/pipeline_script_generator/jenkins_generator.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py index ed155af..8c326ea 100644 --- a/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py +++ b/tools/download_and_deploy/src/pipeline_script_generator/jenkins_generator.py @@ -23,8 +23,6 @@ pipeline { } environment { // 获取源码参数 - // 用于指定Jenkins应该使用哪个凭据来访问源代码存储库,是凭据管理中“唯一标识”的值 - CREDENTIALS_ID = "" // 源代码存储库的克隆地址 GIT_URL = "" // 源代码存储库的克隆分支 -- Gitee