我使用无人驾驶飞机 (0.8.0-rc.5)作为CI工具和无人机-电子邮件插件发送电子邮件。如果生成成功或失败,我想发送通知。我使用Gmail SMTP服务器发送电子邮件。
我的.drone.yml文件:
notify:
image: drillster/drone-email
host: ${EMAIL_HOST}
port: ${EMAIL_PORT}
username: ${EMAIL_USERNAME}
password: ${EMAIL_PASSWORD}
from: test@test.com
recipients: [ user@test.com ]
秘密配置如下所示:
当构建完成时,我会收到以下异常:
time="2017-09-20T02:14:10Z" level=error msg="Error while dialing SMTP server: dial tcp :587: getsockopt: connection refused" dial tcp :587: getsockopt: connection refused
当我在yml文件中硬编码值时,通知可以工作。所以我想知道我对秘密做错了什么,或者如何解决这个问题?
发布于 2017-09-21 01:48:25
您使用的语法,即${secret}
,在undure0.6中被废弃,代之以以下语法:
pipeline:
notify:
image: drillster/drone-email
from: test@test.com
recipients: [ user@test.com ]
secrets: [EMAIL_HOST, EMAIL_PORT, EMAIL_USERNAME, EMAIL_PASSWORD]
上述语法指示无人驾驶飞机向插件提供所需的秘密。秘密以环境变量的形式暴露到容器中,并由插件使用。
进一步阅读
https://stackoverflow.com/questions/46312429
复制相似问题