如何设置在 Concourse 中的工作完成或失败时发送的电子邮件?
问问题
2506 次
2 回答
2
您可以将https://github.com/pivotal-cf/email-resource与 on_failure 步骤一起使用:https ://concourse-ci.org/on-failure-step.html
于 2016-09-29T05:32:38.987 回答
0
我认为这可能已经得到解答,但如果它有帮助,它会看起来像这样:
jobs:
- name: myBuild
plan:
- get: your-repo
passed: []
trigger: false
- task: run-tests
file: runMyTestsTask.yml
on_failure:
- put: send-an-email
params:
subject_text: "Your email subect i.e Failed Build"
body_text: "Your message when the build has failed"
on_success:
put: push-my-build
## Define your additional resources here
resources:
- name: send-an-email
type: email
source:
smtp:
host: smtp.example.com
port: "587" # this must be a string
username: a-user
password: my-password
from: build-system@example.com
to: [ "dev-team@example.com", "product@example.net" ] #optional if `params.additional_recipient` is specified
resource_types:
- name: email
type: docker-image
source:
repository: pcfseceng/email-resource
查看文档以获取有关电子邮件资源 https://github.com/pivotal-cf/email-resource的更多详细信息
于 2020-01-12T17:27:29.947 回答