From 5f843f6072d4a25bd52f86be6fdc08b775813af8 Mon Sep 17 00:00:00 2001 From: WB01533938 Date: Tue, 16 Jul 2024 10:06:14 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=B2=BE=E7=AE=80CI-META=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A7=84=E8=8C=83=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99=E7=9A=84=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=83=A8=E5=88=86=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0maintainers.yaml=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E7=9B=AE=E5=BD=95`../CI=E5=8F=8A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=97=A8=E7=A6=81/=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=96=87=E4=BB=B6/710/`=E4=B8=8B=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=80=85=E6=9D=83=E9=99=90=E6=98=8E=E7=A1=AE?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2\223\351\205\215\347\275\256\350\247\204\350\214\203.md" | 5 ----- 1 file changed, 5 deletions(-) diff --git "a/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" index 9cc2786..e8ba6b5 100644 --- "a/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" +++ "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" @@ -6,11 +6,6 @@ 仓库由三个全局yaml配置和一个自定义目录组成,全局配置无需开发者参与,默认生效,自定义目录允许开发者根据自身需要自定义测试配置,如果开发者对某个仓库配置了自定义测试,则不在运行全局配置的测试。 - -# 全局配置 - -## products.yaml -产品配置文件,用于创建任务和筛选子模块配置。 ```yaml products: Anolis23: #产品名称 -- Gitee From 7b69580b79208cd359829ab18bd5a85f1d82c7bc Mon Sep 17 00:00:00 2001 From: WB01533938 Date: Tue, 16 Jul 2024 10:12:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=B2=BE=E7=AE=80CI-META=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A7=84=E8=8C=83=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99=E7=9A=84=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=83=A8=E5=88=86=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0maintainers.yaml=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E7=9B=AE=E5=BD=95`../CI=E5=8F=8A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=97=A8=E7=A6=81/=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=96=87=E4=BB=B6/710/`=E4=B8=8B=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=80=85=E6=9D=83=E9=99=90=E6=98=8E=E7=A1=AE?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72\223\351\205\215\347\275\256\350\247\204\350\214\203.md" | 4 ---- 1 file changed, 4 deletions(-) diff --git "a/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" index e8ba6b5..8f6a5f8 100644 --- "a/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" +++ "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" @@ -1,10 +1,6 @@ # 简介 [CI-META仓库](https://gitee.com/anolis/ci-meta)做为OpenAnolis社区PackageCI测试流程的配置中心,提供了全局配置和自定义配置,全局配置默认对Gitee上的OpenAnolis企业账户下的所有仓库生效,自定义配置允许开发者通过自定义形式接入社区测试流程,本文主要介绍CI-META仓库配置规范。 - -# 目录结构 -仓库由三个全局yaml配置和一个自定义目录组成,全局配置无需开发者参与,默认生效,自定义目录允许开发者根据自身需要自定义测试配置,如果开发者对某个仓库配置了自定义测试,则不在运行全局配置的测试。 - ```yaml products: -- Gitee From c6a5a91de765f4c775ee3372d3e6ba9efd89058c Mon Sep 17 00:00:00 2001 From: WB01533938 Date: Tue, 16 Jul 2024 10:45:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=B2=BE=E7=AE=80CI-META=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A7=84=E8=8C=83=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99=E7=9A=84=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=83=A8=E5=88=86=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0maintainers.yaml=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E7=9B=AE=E5=BD=95`../CI=E5=8F=8A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=97=A8=E7=A6=81/=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=96=87=E4=BB=B6/710/`=E4=B8=8B=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=80=85=E6=9D=83=E9=99=90=E6=98=8E=E7=A1=AE?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" | 1 - 1 file changed, 1 deletion(-) diff --git "a/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" index 8f6a5f8..25521cc 100644 --- "a/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" +++ "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" @@ -1,6 +1,5 @@ # 简介 -[CI-META仓库](https://gitee.com/anolis/ci-meta)做为OpenAnolis社区PackageCI测试流程的配置中心,提供了全局配置和自定义配置,全局配置默认对Gitee上的OpenAnolis企业账户下的所有仓库生效,自定义配置允许开发者通过自定义形式接入社区测试流程,本文主要介绍CI-META仓库配置规范。 ```yaml products: -- Gitee From 259d0b794de0cfe6622ac9bce18b67423f02f93e Mon Sep 17 00:00:00 2001 From: WB01533938 Date: Tue, 16 Jul 2024 13:41:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=B2=BE=E7=AE=80CI-META=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A7=84=E8=8C=83=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99=E7=9A=84=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=83=A8=E5=88=86=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0maintainers.yaml=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E7=9B=AE=E5=BD=95`../CI=E5=8F=8A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=97=A8=E7=A6=81/=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=96=87=E4=BB=B6/710/`=E4=B8=8B=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=80=85=E6=9D=83=E9=99=90=E6=98=8E=E7=A1=AE?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...15\347\275\256\350\247\204\350\214\203.md" | 190 ++++++++++++++++++ CESHI_ZHUANYONG/maintainers.yaml | 2 +- 2 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 "CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/\346\227\245\345\277\227\346\226\207\344\273\266/710/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" diff --git "a/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/\346\227\245\345\277\227\346\226\207\344\273\266/710/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/\346\227\245\345\277\227\346\226\207\344\273\266/710/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" new file mode 100644 index 0000000..25521cc --- /dev/null +++ "b/CESHI_ZHUANYONG/CI\345\217\212\344\273\243\347\240\201\351\227\250\347\246\201/\346\227\245\345\277\227\346\226\207\344\273\266/710/CI-META\344\273\223\345\272\223\351\205\215\347\275\256\350\247\204\350\214\203.md" @@ -0,0 +1,190 @@ + +# 简介 + +```yaml +products: + Anolis23: #产品名称 + short_name: an23 #产品名缩写,用于创建测试任务 + branch: ['a23'] #匹配分支,分支中包含branch,则匹配成功 + Anolis8: + short_name: an8 + branch: ['a8'] + default: True #默认产品配置 + Anolis7: + short_name: an7 + branch: ['a7'] + Anolis8.4: + short_name: an8.4 + branch: ['a8.4'] + Anolis8.2: + short_name: an8.2 + branch: ['a8.2'] + Anolis7.9: + short_name: an7.9 + branch: ['a7.9'] + Anolis7.7: + short_name: an7.7 + branch: ['a7.7'] +``` + +## toneconfs.yaml +公共测试用例配置文件,可以在globals.yaml和ci.yaml中引用。 +```yaml +basic_test: + tone_workspace: packageci + tone_project: Anolis_Packages + tone_test_suite: anolis-ci-test + tone_test_conf: group=basic_test + tone_test_case: check_license,check_specfile,check_codestyle +rpm_test: + tone_workspace: packageci + tone_project: Anolis_Packages + tone_test_suite: anolis-ci-test + tone_test_conf: group=rpm_test + tone_test_case: pkg_smoke_test,check_abi_diff,check_pkg_dependency +custom_test: + tone_workspace: packageci + tone_project: Anolis_Packages + tone_test_suite: anolis-ci-test + tone_test_conf: group=custom_test + tone_test_case: custom_script +``` + +## globals.yaml +全局配置文件,指明组织仓库运行的测试任务和任务运行方式。 +```yaml +src-anolis-os: #仓库所属组织名称 + code_test: #任务名称 + tone_test: basic_test #任务配置,来自公共测试用例配置文件 + server_config: '{product}-anck-x86_64' #任务运行机器配置,product为产品配置 + abs_build: + type: abs #任务类型,默认为tone + integration_test: + depend: [abs_build] #依赖任务,如果依赖任务失败,则不允许本任务 + tone_test: rpm_test + server_config: #支持不同规格服务器 + x86_64: '{product}-anck-x86_64' + aarch64: '{product}-anck-aarch64' + parallel: #任务运行方式,由上到下串行执行 + - code_test, abs_build #同一层并行执行 + - integration_test +``` + +# 自定义配置 + +## ci.yaml +当全局配置不能满足某个仓库的测试需求时,可以通过配置repos中的ci.yaml来接入自定义配置,ci.yaml中分为仓库配置,测试配置,通知配置。 + +### 仓库配置 +```yaml +#pr,即提交pr就会触发测试,支持gitee平台和github平台 +repo: + git_url: https://gitee.com/anolis/ci-meta.git + trigger_mode: pr + +#pull,定时监测指定仓库分支的commit,如果变化则触发测试 +repo: + git_url: https://gitee.com/anolis/ci-meta.git + git_branch: master + trigger_mode: pull + trigger_time: * * * * * #crontab风格时间表达式 +``` + +### 测试配置 +```yaml +#示例1,引用全局配置 +test: + test_task_1: + tone_test: basic_test + server_config: {product}-anck-x86_64 + +#示例2,覆盖全局配置 +test: + test_task_2: + tone_test: basic_test + basic_test: + tone_test_case: check_license,check_specfile + server_config: {product}-anck-x86_64 + +#示例3,自定义测试配置 +test: + test_task_3: + tone_test: keentune + keentune: + tone_workspace: keentune + tone_project: keentune + tone_test_suite: keentune + tone_test_conf: default + server_config: {product}-anck-x86_64 + +#示例4,自定义脚本配置 +test: + test_task_4: + tone_test: script + entry: test.sh #测试脚本需要放到ci.yaml同级目录中 + server_config: {product}-anck-x86_64 + +#示例5,运行并行测试任务 +test: + test_task_5: + tone_test: basic_test + server_config: {product}-anck-x86_64 + test_task_6: + tone_test: basic_test + server_config: {product}-anck-aarch64 + parallel: + - test_task_5, test_task_6 + +#示例6,运行串行测试任务 +test: + test_task_7: + tone_test: basic_test + server_config: {product}-anck-x86_64 + test_task_8: + tone_test: basic_test + server_config: {product}-anck-aarch64 + parallel: + - test_task_7 + - test_task_8 + +#示例8,扩展T-One配置 +test: + test_task_8: + tone_test: basic_test + basic_test: + tone_test_case: check_license,check_specfile + server_config: {product}-anck-x86_64 + tone_extend: #详细参数请参考 T-One API + need_reboot: 1 + script_info: + - pos: before + script: sleep 10 +``` + +### 通知配置 +```yaml +notice: + notice_mode: any/on_success/on_fail #通知模式,支持任意/仅成功/仅失败 + callback: 'https://xxx.com' + email: ['x1@xx.com', 'x2@xx.com'] + dingding: ['token1', 'token2'] +``` +上述三个部分组成一份ci.yaml,以下是一个完整示例: +```yaml +repo: + git_url: https://gitee.com/anolis/keentune.git + git_branch: master + trigger_mode: pull + trigger_time: 23 * * * * +test: + keentune_test: + tone_test: keentune + keentune: + tone_workspace: packageci + tone_project: Anolis_Packages + tone_test_suite: keentune + tone_test_conf: default + server_config: {product}-anck-x86_64 +notice: + dingding: ['token1', 'token2'] +``` diff --git a/CESHI_ZHUANYONG/maintainers.yaml b/CESHI_ZHUANYONG/maintainers.yaml index c26bfed..478919f 100644 --- a/CESHI_ZHUANYONG/maintainers.yaml +++ b/CESHI_ZHUANYONG/maintainers.yaml @@ -20,6 +20,6 @@ maintainers: # 指定文档目录对应的用户组 paths: - /*: *DG - - ./CI及代码门禁/日志文件/710/: *NG + - ../CI及代码门禁/日志文件/710/: *NG - ./CI及代码门禁/日志文件: *sg # - ../CI及代码门禁/日志文件/710/: *HG -- Gitee