詹金斯建立失败通知-MS团队

发布于 2025-01-31 01:34:34 字数 474 浏览 2 评论 0 原文

我通过Microsoft团队进行了詹金斯(Jenkins)工作的设置通知 - 成功,失败,流产等。

pipeline {
  options {
    office365ConnectorWebhooks([[
                startNotification: true,
                notifySuccess: true,
                notifyFailure: true,
                notifyAborted: true,
                notifyBackToNormal: true,
                    url: 'webhook_url'
        ]]
    )
} }

在上面的脚本的帮助下,除了失败通知以外,我收到了所有通知。

即使我流产了我收到的通知的工作。

谁能在这个问题上提供帮助?

I had set-up notifications via Microsoft Teams for my jenkins job - success, failure, abort, etc.

pipeline {
  options {
    office365ConnectorWebhooks([[
                startNotification: true,
                notifySuccess: true,
                notifyFailure: true,
                notifyAborted: true,
                notifyBackToNormal: true,
                    url: 'webhook_url'
        ]]
    )
} }

With the help of above script i am receiving notifications for all except the failure notifications.

Even i aborted the job i am receiving the notification.

Can anyone help on this issue ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半世蒼涼 2025-02-07 01:34:34

您可以使用 POST 部分和始终条件如下:请注意,无论管道完成状态如何,您都可以定义通知步骤:

pipeline {
    agent any
    stages {
        stage('Test notification') {
            steps {
                echo "Let's simulate a failure"
                error('Failing the build.')
            }
        }
    }
    post { 
        always { 
            echo 'I will always run!'
            office365ConnectorSend status: currentBuild.currentResult, webhookUrl: 'webhook_url'
        }
    }
}

请注意,语法已更改。
要了解有关插件用法的更多信息:

Office 365 Connector Steps

大约Jenkins使用后:
jenkins pipeline syntax

You can define a notification step regardless of the pipeline completion status using the post section and the always condition like the following:

pipeline {
    agent any
    stages {
        stage('Test notification') {
            steps {
                echo "Let's simulate a failure"
                error('Failing the build.')
            }
        }
    }
    post { 
        always { 
            echo 'I will always run!'
            office365ConnectorSend status: currentBuild.currentResult, webhookUrl: 'webhook_url'
        }
    }
}

Note that the syntax has changed.
To learn more about the plugin usage:

Office 365 Connector plugin

Office 365 Connector steps

And about the Jenkins post usage:
Jenkins Pipeline Syntax

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文