使用
的SMTP凭证集成可以的步骤中直接添加集成
部分。
的send_notification效用函数可与a一起使用SMTP凭证集成以发送通知消息。
例子:
|
默认环境变量
当你把这个积分加到一个步骤时,会自动提供一组环境变量。
环境变量 |
描述 |
---|---|
int_ < integration-name > _name |
集成的名称 |
int_ < integration-name > _host |
端点接收有效负载 |
int_ < integration-name > _port |
用于发送电子邮件的端口 |
int_ < integration-name > _hostname |
电子邮件的标识标签 |
int_ < integration-name > _senderEmail |
发件人邮箱地址 |
int_ < integration-name > _username |
授权发送邮件的用户名 |
int_ < integration-name > _password |
授权发送邮件的密码 |
int_ < integration-name > _proxy |
邮件服务器的代理设置 |
int_ < integration-name > _secure |
连接到电子邮件服务器的安全选项 |
int_ < integration-name > _ignoreTLS |
TLS选项连接到电子邮件服务器,而无需使用TLS |
例子
- 此示例使用名为notifySMTP。
- 的send_notification实用函数用于发送的
调用onSuccess
和onFailure
通知。 - 本例的YAML是可以在这个存储库在JFrogGitHub帐户。
发送通知
-名称:smtp_pipe步骤:-名称:test_step_1类型:Bash配置:集成:-名称:notifySMTP #替换为您的SMTP凭据集成的友好名称执行:onSuccess: #替换'notifySMTP'与您的SMTP凭据集成的名称- send_notification notifySMTP——收件人"buildalerts@mycompany.com"——主题"构建成功"——主体"构建docker镜像112.32.101.123:8081/docker-local/demo:$PIPELINE_NAME。$RUN_NUMBER" onFailure: #替换'notifySMTP'与您的SMTP证书集成的名称- send_notification notifySMTP -收件人"buildalerts@mycompany.com" -主题"构建失败" -主体"失败的docker映像112.32.101.123:8081/docker-local/demo:$PIPELINE_NAME.$RUN_NUMBER"