Skip to content

Commit

Permalink
add pipeline event url (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
pipipipipi43 authored Jul 28, 2021
1 parent 2ff6401 commit 75a759f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 75a759f

Please # to comment.