index.yml 2.1 KB
Newer Older
yin-zh's avatar
yin-zh 已提交
1
# 在所有任务之前执行
yin-zh's avatar
yin-zh 已提交
2 3 4 5 6 7 8 9 10
before:
  link: '{{chapter_1_url}}'
  transitions:
    action:
      - type: create_issue
        title: "带你了解冒泡排序"
        with: 001_about_bubble_sort.md
        store:
          chapter_1_url: '{{result.data.html_url}}'
yin-zh's avatar
yin-zh 已提交
11 12 13
      - type: issue_comment.created
        with: 001_algorithm_steps.md
    to: step2
14 15 16

# Task 列表
step1:
yin-zh's avatar
yin-zh 已提交
17
  link: '{{chapter_1_url}}'s
18
  description: "算法步骤"
19
  transitions:
yin-zh's avatar
yin-zh 已提交
20
    events: ['note_events']
21
    action:
yin-zh's avatar
yin-zh 已提交
22
      - type: issue_comment.created
23
        with: 001_algorithm_steps.md
yin-zh's avatar
yin-zh 已提交
24
    to: step2
25

yin-zh's avatar
yin-zh 已提交
26
step2:
yin-zh's avatar
yin-zh 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
  link: '{{chapter_1_url}}'
  description: "编程作业"
  transitions:
    events: ['note_events']
    action:
      - type: choice
        with: code.md
    to: step3

step3:
  link: '{{chapter_1_url}}'
  #  description: "代码提交"
  # 这里要开始监测 ch1 分支的代码提交,同时判断 CI 的结果,Chapter1 是提交截图
  transitions:
    with: 'ch1'
    events: ['push']
    action:
      - type: create_pipeline
        with: 'https://codechina.csdn.net/-/snippets/573/raw/master/.gitlab-ci.yml'
        store:
          ch1_test_url: '{{result.data.html_url}}'
          ch1_test_id: '{{result.data.id}}'
      - type: issue_comment.created
        with: commit_ci_run.md
    to: step4

step4:
  link: '{{chapter_1_url}}'
  # description: "代码提交"
  # 判断CI 结果,成功的话提示下一步,失败的话提示重新 coding
  transitions:
    - with:
      events: ['pipeline']
      left: 'failed'
      operator: '='
      right: '{{object_attributes.status}}'
yin-zh's avatar
yin-zh 已提交
63
      action:
yin-zh's avatar
yin-zh 已提交
64 65 66
        # CI 未通过提示
        - type: pipeline_result
          with: '{{ch1_test_url}}'
yin-zh's avatar
yin-zh 已提交
67
        - type: issue_comment.created
yin-zh's avatar
yin-zh 已提交
68 69 70 71 72 73 74 75 76 77 78 79 80
          with: commit_error.md
      to: step3
    - 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
yin-zh's avatar
yin-zh 已提交
81
      to: end