From 89143454dac4741d74e4866804b2535cdb131870 Mon Sep 17 00:00:00 2001 From: yinzh Date: Tue, 6 Jul 2021 16:43:13 +0800 Subject: [PATCH] cicd test2 --- .../index.yml" | 10 +- .../index.yml" | 94 ++++++++++++++++--- 2 files changed, 86 insertions(+), 18 deletions(-) diff --git "a/01_\347\256\227\346\263\225\345\216\237\347\220\206/index.yml" "b/01_\347\256\227\346\263\225\345\216\237\347\220\206/index.yml" index c179f2e..7017534 100644 --- "a/01_\347\256\227\346\263\225\345\216\237\347\220\206/index.yml" +++ "b/01_\347\256\227\346\263\225\345\216\237\347\220\206/index.yml" @@ -29,11 +29,11 @@ step2: transitions: events: ['close_issue'] action: -# - type: create_issue -# title: "第二章:算法实现" -# with: link.md -# store: -# chapter_2_url: '{{result.data.html_url}}' + - type: create_issue + title: "第二章:算法实现" + with: link.md + store: + chapter_2_url: '{{result.data.html_url}}' - type: issue_comment.created with: 001_end.md to: end 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 331b504..d93b3f3 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,16 +1,84 @@ -## 在所有的任务之前执行 -#before: -# link: '{{chapter_2_url}}' -# transitions: -# action: -# - type: create_issue -# title: "第二章:算法实现" -# with: link.md -# store: -# chapter_2_url: '{{result.data.html_url}}' -# - type: choice -# with: ready.md -# to: step1 +# 在所有的任务之前执行 +before: + link: '{{chapter_2_url}}' + transitions: + action: + - type: create_issue + title: "第二章:算法实现" + with: link.md + store: + chapter_2_url: '{{result.data.html_url}}' + - type: choice + with: ready.md + to: step1 + +# Task 列表 +step1: + link: '{{chapter_2_url}}' + description: "编程作业" + transitions: + events: ['note_events'] + action: + - type: choice + with: code.md + to: step3 + +step2: + link: '{{chapter_2_url}}' + # description: "代码提交" + # 这里要开始监测 ch2 分支的代码提交,同时判断 CI 的结果,Chapter1 是提交截图 + transitions: + with: 'ch2' + events: ['push'] + action: + - type: create_pipeline + with: 'https://codechina.csdn.net/-/snippets/573/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: '{{ch2_test_url}}' + - type: issue_comment.created + with: commit_error.md + to: step3 + - with: '{{ch2_test_id}}' + events: ['pipeline'] + left: 'success' + operator: '=' + right: '{{object_attributes.status}}' + action: + # CI 通过提示 + - type: pipeline_result + with: '{{ch2_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 ## 任务列表 #step1: -- GitLab