DevilKing's blog

冷灯看剑,剑上几分功名?炉香无需计苍生,纵一穿烟逝,万丈云埋,孤阳还照古陵

0%

Travis CI - Step/Job/Stage

原文链接

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
language: go

go:
- "1.8"

before_install:
- echo "before_install"

install:
- echo "install"
-
before_script:
- echo "before_script"

script:
- echo "script"

travisci steps

关于Job的定义,Job 就是一個歷經 TravisCI 生命週期所有步驟的基本單位。

关于Custom job的实现

custom job

引入job:include的概念

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
language: go

go:
- "1.8"

before_install:
- echo "before_install"
install:
- echo "install"
before_script:
- echo "before_script"
script:
- echo "script"

jobs:
include:
- stage: Custom Testing
name: Unit-Testing
go: "1.8"
script: echo "unit script"
- name: Integration-Testing
before_install: "Integration-Testing_before_install"
go: "1.9"
script: "Integration-Testing_script"

Stage 的特色以及概念如下

  1. 由一群 Job 組成
  2. 只要有一個 Job 失敗,該 Stage 就會被視為失敗
  3. 只有當該前 Stage 是成功的狀態,才會執行下一個 Stage

多个stage