From 0074da219c260b73b2d36369e8573af4efdcf16d Mon Sep 17 00:00:00 2001 From: yinzh Date: Tue, 6 Jul 2021 11:32:43 +0800 Subject: [PATCH] cicd test1 --- .../index.yml" | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git "a/02_\347\256\227\346\263\225\345\256\236\347\216\260/index.yml" "b/02_\347\256\227\346\263\225\345\256\236\347\216\260/index.yml" index 8b13789..9295be2 100644 --- "a/02_\347\256\227\346\263\225\345\256\236\347\216\260/index.yml" +++ "b/02_\347\256\227\346\263\225\345\256\236\347\216\260/index.yml" @@ -1 +1,80 @@ +# 在所有的任务之前执行 +before: + link: '{{chapter_2_url}}' + transitions: + action: + - type: choice + with: ready.md + to: step1 + +# 任务列表 +step1: + link: '{{chapter_2_url}}' + description: '编程作业' + transitions: + events: ['note_events'] + action: + - type: choice + - with: code.md + to: step2 + +step2: + link: '{{chapter_2_url}}' + description: "代码提交" + # 这里要开始监测 ch1 分支的代码提交,同时判断 CI 的结果,Chapter1 是提交截图 + transitions: + with: 'ch1' + events: [ 'push' ] + action: + - type: create_pipeline + with: 'https://codechina.csdn.net/-/snippets/318/raw/master/.gitlab-ci.yml' + store: + ch2_test_url: '{{result.data.html_url}}' + ch2_test_id: '{{result.data.id}}' + - type: issue_comment.created + with: commit_ci_run.md + to: step3 + +step3: + link: '{{chapter_2_url}}' + description: "代码提交" + # 判断CI结果,成功的话提示下一步,失败的话重新coding + transitions: + - with: + events: [ 'pipeline' ] + left: 'failed' + operator: '=' + right: '{{object_attributes.status}}' + action: + # CI未通过提示 + - type: pipeline_result + with: '{{ch1_test_url}}' + - type: issue_comment.created + with: commit_ci_error.md + to: step2 + - with: '{{ch1_test_id}}' + events: [ 'pipeline' ] + left: 'success' + operator: '=' + right: '{{object_attributes.status}}' + action: + # CI 通过提示 + - type: pipeline_result + with: '{{ch1_test_url}}' + - type: choice + with: commit_ci_done_option.md + to: step4 + +step4: + link: '{{chapter_2_url}}' + # description: "完成当前章节学习" + transitions: + events: [ 'close_issue' ] + action: + - type: issue_comment.created + with: end.md + to: end + + + -- GitLab