fix no constant: from send-mail.rb:8:in `<main>' /c/compass-ci/lib/mail-post/email_init.rb:9:in `<top (required)>': uninitialized constant REDIS_HOST (NameError)
fix no package: from send-mail.rb:12:in `<main>' /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- rufus-scheduler (LoadError)
Signed-off-by: Luan Shengde shdluan@163.com --- container/send-mail/Dockerfile | 2 +- container/send-mail/send-mail.rb | 4 ++++ container/send-mail/start | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/container/send-mail/Dockerfile b/container/send-mail/Dockerfile index b334b07..29f1bc6 100644 --- a/container/send-mail/Dockerfile +++ b/container/send-mail/Dockerfile @@ -6,4 +6,4 @@ MAINTAINER Luan Shengde shdluan@163.com ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \ - apt-get install -y ruby-mail ruby-json ruby-sinatra + apt-get install -y ruby-mail ruby-json ruby-sinatra ruby-redis ruby-rufus-scheduler diff --git a/container/send-mail/send-mail.rb b/container/send-mail/send-mail.rb index 436736c..387df02 100755 --- a/container/send-mail/send-mail.rb +++ b/container/send-mail/send-mail.rb @@ -5,6 +5,10 @@
require 'mail' require 'sinatra' + +REDIS_HOST = %x(/sbin/ip route | awk '/default/ {print $3}').chomp +REDIS_PORT = ENV['REDIS_PORT'] + require "#{ENV['CCI_SRC']}/lib/mail-post"
mail_server = %x(/sbin/ip route |awk '/default/ {print $3}').chomp diff --git a/container/send-mail/start b/container/send-mail/start index 95d797f..4af533d 100755 --- a/container/send-mail/start +++ b/container/send-mail/start @@ -11,6 +11,7 @@ docker_rm 'send-mail' names = Set.new %w[ LOCAL_SEND_MAIL_PORT LOCAL_ROBOT_EMAIL_ADDRESS + REDIS_PORT ]
defaults = relevant_defaults(names)