I'm using drone-ci (0.8.0-rc.5) as CI tool and drone-email plugin for sending emails. I would like to send notifications if a build succeeded or failed. I use the Gmail SMTP server for sending emails.
My .drone.yml file:
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 ]
Secrets are configured like on the picture below: When the build finishes, I receive following 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
When I hardcode values in yml file, notifications work. So I'm wondering what I'm doing wrong with secrets or how to fix this situation?
The syntax you are using,
${secret}
, was deprecated in drone 0.6 and replaced with the following syntax:The above syntax instructs drone to provide the requested secrets to the plugin. The secrets are exposed into the container as environment variables and consumed by the plugin.
Further reading