[英]rundeck configuration email notifications job in docker
I'd like to configure an email notification for a job done in rundeck with docker.我想为 docker 在 rundeck 中完成的工作配置 email 通知。
I've this docker-compose.yaml and but it doesn't work.我有这个 docker-compose.yaml 但它不起作用。
version: '3'
services:
rundeck:
image: ${RUNDECK_IMAGE:-rundeck/rundeck:SNAPSHOT}
links:
- postgres
environment:
RUNDECK_DATABASE_DRIVER: org.postgresql.Driver
RUNDECK_DATABASE_USERNAME: rundeck
RUNDECK_DATABASE_PASSWORD: rundeck
RUNDECK_DATABASE_URL: jdbc:postgresql://postgres/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
RUNDECK_GRAILS_MAIL_HOST: smtp.gmail.com
RUNDECK_GRAILS_MAIL_USERNAME: email@gmail.com
RUNDECK_GRAILS_MAIL_PORT: 587
RUNDECK_GRAILS_MAIL_PASSWORD: qwqw
volumes:
- ${RUNDECK_LICENSE_FILE:-/dev/null}:/home/rundeck/etc/rundeckpro-license.key
ports:
- 4440:4440
postgres:
image: postgres
expose:
- 5432
environment:
- POSTGRES_DB=rundeck
- POSTGRES_USER=rundeck
- POSTGRES_PASSWORD=rundeck
volumes:
- dbdata:/var/lib/postgresql/data
volumes:
dbdata:
Gmail configuration needs the extended parameters, in the past, an extra file named rundeck-config.groovy
was needed with these extended params in the mail config ( props
section): Gmail 配置需要扩展参数,过去,在邮件配置中需要一个名为rundeck-config.groovy
的额外文件和这些扩展参数( props
部分):
grails {
mail {
host = "smtp.gmail.com"
username = "username@gmail.com"
port = 587
password = "example"
props = ["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"587","mail.smtp.socketFactory.fallback":"false"]
}
}
grails.mail.default.from = "username@gmail.com"
Now, these params are available in the email docker configuration using an env var, take a look at the RUNDECK_MAIL_PROPS
docker env var:现在,这些参数在使用环境变量的email docker 配置中可用,看看RUNDECK_MAIL_PROPS
docker 环境变量:
RUNDECK_MAIL_PROPS=["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"587","mail.smtp.socketFactory.fallback":"false"
Both ways ( groovy
file and env var) work well.两种方式( groovy
文件和环境变量)都运行良好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.