add new environment variable MAILDIR HOST_SERVER used to check whether need to run store-email
attach MAILDIR to the container used to store the mails have been sent MAILDIR/sent
Signed-off-by: Luan Shengde shdluan@163.com --- container/send-internet-mail/start | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/container/send-internet-mail/start b/container/send-internet-mail/start index 483f01a..3803127 100755 --- a/container/send-internet-mail/start +++ b/container/send-internet-mail/start @@ -12,11 +12,14 @@ names = Set.new %w[ ROBOT_EMAIL_ADDRESS ROBOT_EMAIL_PASSWORD SEND_MAIL_PORT + MAILDIR ]
defaults = relevant_defaults(names)
defaults['CCI_SRC'] = '/c/compass-ci' +defaults['MAILDIR'] ||= '/srv/cci/Maildir/.compass-ci' +defaults['HOST_SERVER'] = ENV['HOSTNAME']
env = docker_env(defaults)
@@ -27,10 +30,10 @@ cmd = %W[ -d ] + env + %W[ -p #{defaults['SEND_MAIL_PORT']}:#{defaults['SEND_MAIL_PORT']} + -v #{defaults['MAILDIR']}:#{defaults['MAILDIR']}:rw -v #{ENV['CCI_SRC']}:#{defaults['CCI_SRC']} -v /etc/localtime:/etc/localtime:ro -w #{defaults['CCI_SRC']}/container/send-internet-mail - --log-driver json-file send-internet-mail ]