Skip to content

Commit 56fb80e

Browse files
authored
docs: add v1 stage plugin pages (wait, wait-approval, script-run) (#7078)
Signed-off-by: rahulshendre <rahulshendre789@gmail.com>
1 parent b2bb06a commit 56fb80e

4 files changed

Lines changed: 159 additions & 4 deletions

File tree

docs/content/en/docs-v1.0.x/plugins/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ The PipeCD maintainers develop and maintain the following plugins. Each plugin i
4444

4545
| Plugin | Stage | Description |
4646
|--------|-------|-------------|
47-
| Wait | `WAIT` | Waits for a specified duration before continuing the pipeline. |
48-
| Wait approval | `WAIT_APPROVAL` | Pauses the pipeline until a user approves the deployment. |
49-
| Analysis | `ANALYSIS` | Evaluates the deployment by querying metrics, logs, or HTTP endpoints. |
50-
| Script run | `SCRIPT_RUN` | Runs arbitrary commands as a pipeline stage. |
47+
| [Wait](wait/) | `WAIT` | Waits for a specified duration before continuing the pipeline. |
48+
| [Wait approval](wait-approval/) | `WAIT_APPROVAL` | Pauses the pipeline until a user approves the deployment. |
49+
| [Analysis](analysis/) | `ANALYSIS` | Evaluates the deployment by querying metrics, logs, or HTTP endpoints. |
50+
| [Script run](script-run/) | `SCRIPT_RUN` | Runs arbitrary commands as a pipeline stage. |
5151

5252
## Community plugins
5353

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: "Script run plugin"
3+
linkTitle: "Script run"
4+
weight: 70
5+
description: >
6+
Run arbitrary commands as a pipeline stage.
7+
---
8+
9+
The `scriptrun` plugin provides the `SCRIPT_RUN` stage, which runs arbitrary shell commands as a step in the pipeline. Because it is a stage plugin, `SCRIPT_RUN` can be added to any deployment pipeline. It is useful for tasks such as smoke tests, notifications, or custom checks between deployment stages.
10+
11+
## Prerequisites
12+
13+
Register the plugin in the piped configuration:
14+
15+
```yaml
16+
apiVersion: pipecd.dev/v1beta1
17+
kind: Piped
18+
spec:
19+
# ...
20+
plugins:
21+
- name: scriptrun
22+
port: 7006
23+
url: file:///path/to/plugin/binary # or an https:// release URL
24+
```
25+
26+
## The SCRIPT_RUN stage
27+
28+
Add a `SCRIPT_RUN` stage and set the command to run under `with.run`. You can pass environment variables with `env`, and provide an `onRollback` command that runs if the deployment is rolled back:
29+
30+
```yaml
31+
pipeline:
32+
stages:
33+
- name: K8S_CANARY_ROLLOUT
34+
- name: SCRIPT_RUN
35+
with:
36+
env:
37+
APP_URL: https://example.com
38+
run: |
39+
curl -sSf "$APP_URL/healthz"
40+
onRollback: |
41+
echo "rolling back"
42+
- name: K8S_PRIMARY_ROLLOUT
43+
```
44+
45+
If `onRollback` is set, PipeCD runs it during rollback through an automatically inserted `SCRIPT_RUN_ROLLBACK` stage. You do not add `SCRIPT_RUN_ROLLBACK` to your pipeline.
46+
47+
## Configuration reference
48+
49+
### SCRIPT_RUN stage options
50+
51+
| Field | Type | Description | Required |
52+
|-------|------|-------------|----------|
53+
| run | string | The command(s) to run. | Yes |
54+
| env | map[string]string | Environment variables to set when running the command. | No |
55+
| onRollback | string | The command(s) to run if the deployment is rolled back. | No |
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: "Wait approval plugin"
3+
linkTitle: "Wait approval"
4+
weight: 50
5+
description: >
6+
Pause the pipeline until a user approves.
7+
---
8+
9+
The `waitapproval` plugin provides the `WAIT_APPROVAL` stage, which pauses the pipeline until the required number of users approve the deployment from the PipeCD console. Because it is a stage plugin, `WAIT_APPROVAL` can be added to any deployment pipeline.
10+
11+
## Prerequisites
12+
13+
Register the plugin in the piped configuration:
14+
15+
```yaml
16+
apiVersion: pipecd.dev/v1beta1
17+
kind: Piped
18+
spec:
19+
# ...
20+
plugins:
21+
- name: waitapproval
22+
port: 7005
23+
url: file:///path/to/plugin/binary # or an https:// release URL
24+
```
25+
26+
## The WAIT_APPROVAL stage
27+
28+
Add a `WAIT_APPROVAL` stage and set the approvers and the number of approvals required under `with`. For example, require one approval before applying an infrastructure change:
29+
30+
```yaml
31+
pipeline:
32+
stages:
33+
- name: TERRAFORM_PLAN
34+
- name: WAIT_APPROVAL
35+
with:
36+
approvers:
37+
- user-a
38+
- user-b
39+
minApproverNum: 1
40+
- name: TERRAFORM_APPLY
41+
```
42+
43+
The stage waits until at least `minApproverNum` users have approved it from the console, then continues.
44+
45+
## Configuration reference
46+
47+
### WAIT_APPROVAL stage options
48+
49+
| Field | Type | Description | Required |
50+
|-------|------|-------------|----------|
51+
| approvers | []string | Users designated as approvers of the deployment. | Yes |
52+
| minApproverNum | int | Number of approvals required before the pipeline continues. | No (default `1`) |
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "Wait plugin"
3+
linkTitle: "Wait"
4+
weight: 40
5+
description: >
6+
Pause the pipeline for a fixed duration.
7+
---
8+
9+
The `wait` plugin provides the `WAIT` stage, which pauses the pipeline for a fixed duration before continuing to the next stage. Because it is a stage plugin, `WAIT` can be added to any deployment pipeline.
10+
11+
## Prerequisites
12+
13+
Register the plugin in the piped configuration:
14+
15+
```yaml
16+
apiVersion: pipecd.dev/v1beta1
17+
kind: Piped
18+
spec:
19+
# ...
20+
plugins:
21+
- name: wait
22+
port: 7004
23+
url: file:///path/to/plugin/binary # or an https:// release URL
24+
```
25+
26+
## The WAIT stage
27+
28+
Add a `WAIT` stage and set how long to pause under `with.duration`. For example, wait 5 minutes between a canary rollout and the primary rollout:
29+
30+
```yaml
31+
pipeline:
32+
stages:
33+
- name: K8S_CANARY_ROLLOUT
34+
with:
35+
replicas: 10%
36+
- name: WAIT
37+
with:
38+
duration: 5m
39+
- name: K8S_PRIMARY_ROLLOUT
40+
```
41+
42+
## Configuration reference
43+
44+
### WAIT stage options
45+
46+
| Field | Type | Description | Required |
47+
|-------|------|-------------|----------|
48+
| duration | duration | How long to pause before continuing (e.g. `5m`). | Yes |

0 commit comments

Comments
 (0)