使用无人机电子邮件插件时,无人机CI不会看到秘密variables

我使用的是无线电话(0.8.0-rc.5)作为CI工具和无人机电子邮件插件发送电子邮件。 如果构build成功或失败,我想发送通知。 我使用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 ] 

秘密的configuration如下图所示: 在这里输入图像说明 构build完成后,我收到以下exception:

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文件中硬编码值时,通知工作。 所以我想知道我在做什么错误的秘密或如何解决这种情况?

您正在使用的语法${secret}已在drone 0.6中被弃用,并被以下语法replace:

 pipeline: notify: image: drillster/drone-email from: test@test.com recipients: [ user@test.com ] secrets: [EMAIL_HOST, EMAIL_PORT, EMAIL_USERNAME, EMAIL_PASSWORD] 

上面的语法指示无人机向插件提供所请求的秘密。 这些秘密作为环境variables暴露在容器中,并被插件所使用。

进一步阅读