【问题标题】:How to send email via Concourse CI pipeline?如何通过 Concourse CI 管道发送电子邮件?
【发布时间】:2016-09-28 15:56:24
【问题描述】:

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

【问题讨论】:

    标签: continuous-integration email concourse


    【解决方案1】:

    【讨论】:

    • 这个可以扩展吗?您如何在失败任务中使用“放置”资源?请举例?
    【解决方案2】:

    我认为这可能已经得到解答,但如果它有帮助,它会看起来像这样:

    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-04-29
      • 2013-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多