如何通过Concourse CI管道发送电子邮件?

时间:2016-09-28 15:56:25

标签: continuous-integration email-integration concourse

如何在Concourse完成工作或失败时设置发送的电子邮件?

2 个答案:

答案 0 :(得分:2)

答案 1 :(得分: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