Docs: fix workflow docs (#273)
This commit is contained in:
parent
45516efbdc
commit
7b80a8aaf5
|
|
@ -86,6 +86,8 @@ spec:
|
|||
policy:
|
||||
numerical:
|
||||
order: asc
|
||||
# add more commit message
|
||||
commitMessage: "Image: {{range .Updated.Images}}{{println .}}{{end}}"
|
||||
```
|
||||
|
||||
Apply the file to the cluster and check the `Application` in clusters, we can see that the `git-app` automatically pulls the config from Git Repository and apply the application to the cluster:
|
||||
|
|
@ -126,7 +128,7 @@ func main() {
|
|||
|
||||
Commit the change to the Git Repository, we can see that our CI pipelines has built the image and push it to the image registry.
|
||||
|
||||
KubeVela will then listening to the image registry and update the `Application` in Git Repository with the latest image tag. We can see that there is a commit form `kubevelabot`, the commit message is `Update image automatically.`
|
||||
KubeVela will then listening to the image registry and update the `Application` in Git Repository with the latest image tag. We can see that there is a commit form `kubevelabot`, the commit message is always with a prefix `Update image automatically.` You can use format like `{{range .Updated.Images}}{{println .}}{{end}}` to specify the image name in the `commitMessage` field.
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ We can write `valueFrom` in the following ways:
|
|||
|
||||
### Inputs
|
||||
|
||||
Inputs is made of `name` and `parameterKey`. Input uses `name` to reference output, `parameterKey` is a expression that assigns the value of the input to the corresponding field.
|
||||
Inputs is made of `from` and `parameterKey`. Input uses `from` to reference output, `parameterKey` is a expression that assigns the value of the input to the corresponding field.
|
||||
|
||||
eg.
|
||||
|
||||
|
|
|
|||
|
|
@ -48,23 +48,31 @@ spec:
|
|||
properties:
|
||||
dingding:
|
||||
# the DingTalk webhook address, please refer to: https://developers.dingtalk.com/document/robots/custom-robot-access
|
||||
url: xxx
|
||||
url: <your dingding url>
|
||||
# specify the message details
|
||||
message:
|
||||
msgtype: text
|
||||
text:
|
||||
context: Workflow starting...
|
||||
content: Workflow starting...
|
||||
- name: application
|
||||
type: apply-application
|
||||
type: apply-component
|
||||
properties:
|
||||
component: express-server
|
||||
outputs:
|
||||
- from: app-status
|
||||
exportKey: output.status.conditions[0].message + "工作流运行完成"
|
||||
- name: slack-message
|
||||
type: webhook-notification
|
||||
inputs:
|
||||
- name: app-status
|
||||
parameterKey: properties.slack.message.text
|
||||
properties:
|
||||
slack:
|
||||
# the Slack webhook address, please refer to: https://api.slack.com/messaging/webhooks
|
||||
url: xxx
|
||||
# specify the message details
|
||||
message:
|
||||
text: Workflow ended.
|
||||
url: <your slack url>
|
||||
# specify the message details, will be filled by the input value
|
||||
# message:
|
||||
# text: condition message + Workflow ended.
|
||||
```
|
||||
|
||||
## Expected outcome
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ spec:
|
|||
type: helm
|
||||
properties:
|
||||
repoType: helm
|
||||
repoUrl: https://charts.bitnami.com/bitnami
|
||||
url: https://charts.bitnami.com/bitnami
|
||||
chart: tomcat
|
||||
version: "9.2.20"
|
||||
workflow:
|
||||
|
|
@ -141,7 +141,7 @@ spec:
|
|||
properties:
|
||||
slack:
|
||||
# the address of your slack webhook, please refer to: https://api.slack.com/messaging/webhooks
|
||||
url: slack url
|
||||
url: <your slack url>
|
||||
```
|
||||
|
||||
Apply the Application to the cluster and you can see that all resources have been successfully applied and Slack has received the messages of the Deployment status.
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 237 KiB |
|
|
@ -88,6 +88,8 @@ spec:
|
|||
policy:
|
||||
numerical:
|
||||
order: asc
|
||||
# 追加提交信息
|
||||
commitMessage: "Image: {{range .Updated.Images}}{{println .}}{{end}}"
|
||||
```
|
||||
|
||||
将上述文件部署到集群中后,查看集群中的应用,可以看到,应用 `git-app` 自动拉取了 Git 仓库中的应用配置并部署到了集群中:
|
||||
|
|
@ -128,7 +130,7 @@ func main() {
|
|||
|
||||
提交该改动至代码仓库,可以看到,我们配置的 CI 流水线开始构建镜像并推送至镜像仓库。
|
||||
|
||||
而 KubeVela 会通过监听镜像仓库,根据最新的镜像 Tag 来更新代码仓库中的 `Application`。此时,可以看到代码仓库中有一条来自 `kubevelabot` 的提交,提交信息为 `Update image automatically.`
|
||||
而 KubeVela 会通过监听镜像仓库,根据最新的镜像 Tag 来更新代码仓库中的 `Application`。此时,可以看到代码仓库中有一条来自 `kubevelabot` 的提交,提交信息均带有 `Update image automatically.` 前缀。你也可以通过 `{{range .Updated.Images}}{{println .}}{{end}}` 在 `commitMessage` 字段中追加你所需要的信息。
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名
|
|||
|
||||
### Inputs
|
||||
|
||||
inputs 由 `name` 和 `parameterKey` 组成。`name` 声明了这个 input 从哪个 output 中取值,`parameterKey` 为一个表达式,将会把 input 取得的值赋给对应的字段。
|
||||
inputs 由 `from` 和 `parameterKey` 组成。`from` 声明了这个 input 从哪个 output 中取值,`parameterKey` 为一个表达式,将会把 input 取得的值赋给对应的字段。
|
||||
|
||||
如:
|
||||
1. 指定 inputs:
|
||||
|
|
|
|||
|
|
@ -48,23 +48,31 @@ spec:
|
|||
properties:
|
||||
dingding:
|
||||
# 钉钉 Webhook 地址,请查看:https://developers.dingtalk.com/document/robots/custom-robot-access
|
||||
url: xxx
|
||||
url: <your dingding url>
|
||||
# 具体要发送的信息详情
|
||||
message:
|
||||
msgtype: text
|
||||
text:
|
||||
context: 开始运行工作流
|
||||
content: 开始运行工作流
|
||||
- name: application
|
||||
type: apply-application
|
||||
type: apply-component
|
||||
properties:
|
||||
component: express-server
|
||||
outputs:
|
||||
- from: app-status
|
||||
exportKey: output.status.conditions[0].message + "工作流运行完成"
|
||||
- name: slack-message
|
||||
type: webhook-notification
|
||||
inputs:
|
||||
- name: app-status
|
||||
parameterKey: properties.slack.message.text
|
||||
properties:
|
||||
slack:
|
||||
# Slack Webhook 地址,请查看:https://api.slack.com/messaging/webhooks
|
||||
url: xxx
|
||||
# 具体要发送的信息详情
|
||||
message:
|
||||
text: 工作流运行完成
|
||||
url: <your slack url>
|
||||
# 具体要发送的信息详情,会被 input 中的值覆盖
|
||||
# message:
|
||||
# text: condition message + 工作流运行完成
|
||||
```
|
||||
|
||||
## 期望结果
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ spec:
|
|||
chart: ./charts/kruise/v0.9.0
|
||||
version: "*"
|
||||
repoType: git
|
||||
repoUrl: https://github.com/openkruise/kruise
|
||||
url: https://github.com/openkruise/kruise
|
||||
dependsOn:
|
||||
- ref:
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ spec:
|
|||
type: helm
|
||||
properties:
|
||||
repoType: helm
|
||||
repoUrl: https://charts.bitnami.com/bitnami
|
||||
url: https://charts.bitnami.com/bitnami
|
||||
chart: tomcat
|
||||
version: "9.2.20"
|
||||
workflow:
|
||||
|
|
@ -141,7 +141,7 @@ spec:
|
|||
properties:
|
||||
slack:
|
||||
# 你的 slack webhook 地址,请参考:https://api.slack.com/messaging/webhooks
|
||||
url: slack url
|
||||
url: <your slack url>
|
||||
```
|
||||
|
||||
将该应用部署到集群中,可以看到所有的资源都已被成功部署,且 Slack 中收到了对应的通知,通知内容为该 Deployment 的状态信息。
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 237 KiB |
Loading…
Reference in New Issue