Skip to content

Commit

Permalink
fix(publisher): fix failure notify message (#203)
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <[email protected]>

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo authored Nov 13, 2024
1 parent 76c6429 commit 93bf843
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions publisher/example/config/worker-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tiup:
mirror_url: http://tiup.mirror.site
lark_webhook_url: https://feishu.custom-bot-webhook # create and copy the url then paste here.
nightly_interval: 1h
public_service_url: http://publisher.ns.svc

file_server:
kafka:
Expand Down
11 changes: 2 additions & 9 deletions publisher/pkg/impl/tiup_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,9 @@ func (p *tiupWorker) notifyLark(req *PublishRequest, err error) {
return
}

rerunCmd := fmt.Sprintf(`go run %s --url %s tiup request-to-publish --body '{"artifact_url": "%s"}'`,
"github.com/PingCAP-QE/ee-apps/publisher/cmd/publisher-cli@main",
p.options.PublicServiceURL,
req.From.String(),
)

info := failureNotifyInfo{
Title: "TiUP Publish Failed",
FailedMessage: err.Error(),
RerunCommands: rerunCmd,
Params: [][2]string{
{"package", req.Publish.Name},
{"version", req.Publish.Version},
Expand Down Expand Up @@ -195,8 +188,8 @@ func (p *tiupWorker) publish(file string, info *PublishInfo) error {
p.logger.Debug().Any("args", command.Args).Any("env", command.Args).Msg("will execute tiup command")
output, err := command.Output()
if err != nil {
p.logger.Err(err).Msg("failed to execute tiup command")
return err
p.logger.Err(err).Bytes("output", output).Msg("tiup command execute failed")
return fmt.Errorf("tiup command execute failed:\n%s", output)
}
p.logger.Info().
Str("mirror", p.options.MirrorURL).
Expand Down

0 comments on commit 93bf843

Please sign in to comment.