Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pipeline event url #1189

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/dop/services/cdp/cdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/erda-project/erda/apistructs"
"github.com/erda-project/erda/bundle"
"github.com/erda-project/erda/modules/dop/conf"
)

// CDP pipeline 结构体
Expand Down Expand Up @@ -165,9 +166,13 @@ func (cdp *CDP) CdpNotifyProcess(pipelineEvent *apistructs.PipelineInstanceEvent
params := map[string]string{
"pipelineID": strconv.FormatUint(pipelineData.PipelineID, 10),
"notifyItemName": notifyItem.DisplayName,
"appID": strconv.FormatUint(pipelineDetail.ApplicationID, 10),
"appName": pipelineDetail.ApplicationName,
"projectID": strconv.FormatUint(pipelineDetail.ProjectID, 10),
"projectName": pipelineDetail.ProjectName,
"orgName": pipelineDetail.OrgName,
"branch": pipelineDetail.Branch,
"uiPublicURL": conf.UIPublicURL(),
}
//失败情况尝输出错误日志
if notifyItem.Name == "pipeline_failed" {
Expand Down
4 changes: 2 additions & 2 deletions pkg/erda-configs/i18n/notify_item.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ zh-CN:
- 信息:{{message}}
notify.pipeline.pipeline_success: 流水线运行成功
notify.pipeline.pipeline_success.markdown_template: |-
### {{projectName}}/{{appName}} 流水线{{pipelineID}}运行成功
### {{projectName}}/{{appName}} 流水线 {{pipelineID}} 运行成功 {{uiPublicURL}}/{{orgName}}/dop/projects/{{projectID}}/apps/{{appID}}/pipeline?pipelineID={{pipelineID}}
notify.pipeline.pipeline_running: 流水线开始运行
notify.pipeline.pipeline_running.markdown_template: |-
### {{projectName}}/{{appName}} 流水线{{pipelineID}}开始运行
notify.pipeline.pipeline_failed: 流水线运行失败
notify.pipeline.pipeline_failed.markdown_template: |-
### {{projectName}}/{{appName}} 流水线{{pipelineID}}运行失败
### {{projectName}}/{{appName}} 流水线 {{pipelineID}} 运行失败 {{uiPublicURL}}/{{orgName}}/dop/projects/{{projectID}}/apps/{{appID}}/pipeline?pipelineID={{pipelineID}}
{{failedDetail}}
notify.issue.issue_create: 创建任务事件
notify.issue.issue_create.markdown_template: "事件【{{issue_title}}】{{content}}"
Expand Down