Skip to content

Commit 4a13c6c

Browse files
committed
Sync from pcit-ce/pcit@f5680f9 by PCIT
1 parent 86ac504 commit 4a13c6c

File tree

11 files changed

+59
-64
lines changed

11 files changed

+59
-64
lines changed

.pcit.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ steps:
66

77
upload-docs:
88
image: pcit/pages
9-
when:
9+
if:
1010
status: success
1111
event: ['push']
12-
settings:
12+
with:
1313
keep_history: true
1414
# target_branch: gh-pages
1515
git_url: github.com/pcit-ce/docs
@@ -21,10 +21,10 @@ steps:
2121

2222
upload-docs-to-gitee:
2323
image: pcit/pages
24-
when:
24+
if:
2525
status: success
2626
event: ['push']
27-
settings:
27+
with:
2828
keep_history: true
2929
# target_branch: gh-pages
3030
git_url: gitee.com/pcit-ce/docs

.vuepress/config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ module.exports = {
4444
'language',
4545
'clone',
4646
'workspace',
47-
'pipeline',
47+
'steps',
4848
'services',
49-
'matrix',
49+
'jobs',
5050
'cache',
5151
'branches',
52-
'notifications',
52+
'image',
5353
'networks',
5454
'system',
5555
'platform',

SUMMARY.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
* [language](usage/language.md)
1919
* [clone](usage/clone.md)
2020
* [workspace](usage/workspace.md)
21-
* [pipeline](usage/pipeline.md)
21+
* [steps](usage/steps.md)
2222
* [services](usage/services.md)
23-
* [matrix](usage/matrix.md)
23+
* [jobs](usage/jobs.md)
2424
* [cache](usage/cache.md)
2525
* [branches](usage/branches.md)
26-
* [notifications](usage/notifications.md)
26+
* [image](usage/image.md)
2727
* [networks](usage/networks.md)
2828
* [system](usage/system.md)
2929
* [skip build](usage/skip.md)

api/system/README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,46 @@
44

55
| Method | URL |
66
| :----- | :-----------------------|
7-
| `GET` | `/ci/oauth_client_id` |
7+
| `GET` | `/ci/oauth_client_id` |
88

99
**Example:** `/ci/oauth_client_id`
1010

1111
## 获取系统待构建任务数
1212

1313
| Method | URL |
1414
| :----- | :-----------------------|
15-
| `GET` | `/ci/pending` |
15+
| `GET` | `/ci/pending` |
1616

1717
## 获取 GitHub App 安装地址
1818

1919
| Method | URL |
2020
| :----- | :----------------------- |
21-
| `GET` | `/ci/github_app_installation/{uid}` |
21+
| `GET` | `/ci/github_app_installation/{uid}` |
2222

2323
## 获取 GitHub App 设置地址
2424

2525
| Method | URL |
2626
| :----- | :----------------------- |
27-
| `GET` | `/ci/github_app_settings/{org_name}` |
27+
| `GET` | `/ci/github_app_settings/{org_name}` |
2828

2929
## About
3030

3131
> 获取 PCIT 描述文件(md 格式)
3232
3333
| Method | URL |
3434
| :--- | :--- |
35-
| `GET` | `/ci/about` |
35+
| `GET` | `/ci/about` |
3636

3737
## Changelog
3838

3939
> 获取 PCIT `CHANGELOG` 描述文件(md 格式)
4040
4141
| Method | URL |
4242
| :--- | :--- |
43-
| `GET` | `/ci/changelog` |
43+
| `GET` | `/ci/changelog` |
44+
45+
## 验证 `.pcit.yml`
46+
47+
| Method | URL |
48+
| :--- | :--- |
49+
| `POST` | `/validate` |

usage/image.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# image
2+
3+
`image` 指令用来设置 `steps` 的默认镜像。
4+
5+
```yaml
6+
steps:
7+
script: echo exec script
8+
9+
image: khs1994/php:7.4.0-cli-alpine
10+
```
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
# matrix
1+
# jobs
22

3-
`matrix` 用来设置构建矩阵。常见的场景就是项目需要在不同的软件版本中进行测试。
3+
`jobs` 用来设置构建矩阵。常见的场景就是项目需要在不同的软件版本中进行测试。
44

55
例如我们需要在 PHP 7.4 和 7.3 版本中进行测试。
66

77
```yaml
8-
pipeline:
8+
steps:
99
php:
1010
image: khs1994/php-fpm:${PHP_TAG}
1111
...
1212

13-
matrix:
13+
jobs:
1414
PHP_TAG:
1515
- 7.4.3-alpine
1616
- 7.3.11-alpine
1717
```
1818
1919
我们在 `image` 指令中设置变量 `${PHP_TAG}`
2020

21-
在 `matrix` 中设置变量值
21+
在 `jobs` 中设置变量值
2222

2323
以上构建相当于
2424

2525
```yaml
26-
pipeline:
26+
steps:
2727
php:
2828
image: khs1994/php-fpm:7.4.3-alpine
2929
...
@@ -33,4 +33,4 @@ pipeline:
3333
...
3434
```
3535

36-
很明显 `matrix` 指令的使用可以简化 `pipeline` 指令。同时很适用于项目需要在多个软件版本中进行测试、构建的场景。
36+
很明显 `jobs` 指令的使用可以简化 `steps` 指令。同时很适用于项目需要在多个软件版本中进行测试、构建的场景。

usage/language.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# language
22

3-
设置项目的语言,该指令影响 `pipeline` 的默认 `image` 等值。
3+
设置项目的语言,该指令影响 `steps` 的默认 `image` 等值。
44

55
```yaml
66
language: php

usage/networks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## 自定义 hosts
66

77
```yaml
8-
pipeline:
8+
steps:
99
ping:
1010
commands:
1111
- ping

usage/notifications.md

-21
This file was deleted.

usage/platform.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# platform
22

3-
`platform` 指令只对 `steps/pipeline` 有效,对 `services` 无效。与 `docker run --platform` 参数的作用一致。
3+
`platform` 指令只对 `steps` 有效,对 `services` 无效。与 `docker run --platform` 参数的作用一致。
44

55
```yaml
66
platform:

usage/pipeline.md renamed to usage/steps.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# pipeline
1+
# steps
22

33
## 基本指令
44

5-
`pipeline` 指令用来设置具体的构建步骤,每个步骤均运行在容器中,所以每个步骤必须首先指定 Docker Image 名称 (`image`) 和具体的构建指令 (`commands`) 。
5+
`steps` 指令用来设置具体的构建步骤,每个步骤均运行在容器中,所以每个步骤必须首先指定 Docker Image 名称 (`image`) 和具体的构建指令 (`commands`) 。
66

7-
> pipeline 指令可以包含多个构建步骤
7+
> steps 指令可以包含多个构建步骤
88
99
```yaml
10-
pipeline:
10+
steps:
1111
php:
1212
image: khs1994/php-fpm:7.4.3-alpine
1313
commands:
@@ -29,12 +29,12 @@ pipeline:
2929

3030
设置构建步骤所运行的命令。
3131

32-
## 3. `environment` 环境变量
32+
## 3. `environment`
3333

3434
除了以上两个基本指令外,还可以像我们平时使用 `$ docker container run -e "K=V" ...` 命令那样设置 **环境变量**。
3535

3636
```yaml
37-
pipeline:
37+
steps:
3838
php:
3939
image: khs1994/php-fpm:7.4.3-alpine
4040
environment:
@@ -44,12 +44,12 @@ pipeline:
4444
- vendor/bin/phpunit
4545
```
4646

47-
## 4. `pull` 镜像拉取策略
47+
## 4. `pull`
4848

4949
每次构建时,无论 Docker Image 是否存在总是拉取镜像,可以使用 `pull: true` 指令(默认为 `false`)。
5050

5151
```yaml
52-
pipeline:
52+
steps:
5353
php:
5454
image: khs1994/php-fpm:7.4.3-alpine
5555
pull: true
@@ -63,35 +63,35 @@ pipeline:
6363
默认的 shell 为 `sh`,你可以改为 `bash`
6464

6565
```yaml
66-
pipeline:
66+
steps:
6767
php:
6868
image: khs1994/php-fpm:7.4.3-alpine
6969
shell: bash
7070
```
7171

7272
全部支持的 `shell` 包括 `sh` `bash` `python` `pwsh` `node`
7373

74-
## 6. `when` 构建条件
74+
## 6. `if`
7575

76-
可以通过 `when` 指令设置构建条件。
76+
可以通过 `if` 指令设置构建条件。
7777

7878
```yaml
79-
pipeline:
79+
steps:
8080
php:
8181
image: khs1994/php-fpm:7.4.3-alpine
8282
commands:
8383
- composer install -q
8484
- vendor/bin/phpunit
85-
when:
85+
if:
8686
event: tag
8787
```
8888

89-
增加以上的 `when` 指令之后,构建仅在 Git 打标签之后执行,当 push、pull_request 均不进行构建。
89+
增加以上的 `if` 指令之后,构建仅在 Git 打标签之后执行,当 push、pull_request 均不进行构建。
9090

9191
全部可用的设置如下:
9292

9393
```yaml
94-
when:
94+
if:
9595
# platform: linux/amd64
9696
# platform: [ linux/*, windows/amd64 ]
9797
@@ -109,7 +109,7 @@ when:
109109
# include: [ master, release/* ]
110110
# exclude: [ release/1.0.0, release/1.1.* ]
111111
112-
# matrix:
112+
# jobs:
113113
# - K: v
114114
# K2: v2
115115
# K3: v3
@@ -124,7 +124,7 @@ when:
124124
该指令用来配置插件。
125125

126126
```yaml
127-
pipeline:
127+
steps:
128128
settings:
129129
provider: docker
130130
k: v

0 commit comments

Comments
 (0)