[Why] most file use "SEND_MAIL_HOST/PORT"
[How] sed -i "s/[^_]MAIL_HOST/SEND_MAIL_HOST/g" `grep MAIL_HOST -rl compass-ci/*` sed -i "s/[^_]MAIL_PORT/SEND_MAIL_PORT/g" `grep MAIL_PORT -rl compass-ci/*`
Signed-off-by: Lu Weitao luweitaobe@163.com --- container/delimiter/start | 4 ++-- container/extract-stats/start | 4 ++-- lib/constants.rb | 4 ++-- lib/mail_client.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/container/delimiter/start b/container/delimiter/start index 5d7037d..cb44d84 100755 --- a/container/delimiter/start +++ b/container/delimiter/start @@ -9,8 +9,8 @@ require_relative '../defconfig.rb' names = Set.new %w[ ES_HOST ES_PORT - MAIL_HOST - MAIL_PORT + SEND_MAIL_HOST + SEND_MAIL_PORT MONITOR_HOST MONITOR_PORT TASKQUEUE_HOST diff --git a/container/extract-stats/start b/container/extract-stats/start index 74cf917..6510564 100755 --- a/container/extract-stats/start +++ b/container/extract-stats/start @@ -12,8 +12,8 @@ names = Set.new %w[ REDIS_PORT ES_HOST ES_PORT - MAIL_HOST - MAIL_PORT + SEND_MAIL_HOST + SEND_MAIL_PORT LAB ]
diff --git a/lib/constants.rb b/lib/constants.rb index c3c7543..a274adc 100644 --- a/lib/constants.rb +++ b/lib/constants.rb @@ -8,8 +8,8 @@ config = cci_defaults ES_HOST = config['ES_HOST'] || '172.17.0.1' ES_PORT = config['ES_PORT'] || 9200
-MAIL_HOST = config['SEND_MAIL_HOST'] || '172.17.0.1' -MAIL_PORT = config['SEND_MAIL_PORT'] || 49000 +SEND_MAIL_HOST = config['SEND_MAIL_HOST'] || '172.17.0.1' +SEND_MAIL_PORT = config['SEND_MAIL_PORT'] || 49000
SRV_HTTP_HOST = config['SRV_HTTP_HOST'] || ENV['SRV_HTTP_HOST'] || '172.17.0.1' SRV_HTTP_PORT = config['SRV_HTTP_PORT'] || ENV['SRV_HTTP_PORT'] || 11300 diff --git a/lib/mail_client.rb b/lib/mail_client.rb index f63e65d..6f5a099 100644 --- a/lib/mail_client.rb +++ b/lib/mail_client.rb @@ -8,8 +8,8 @@ require_relative 'constants.rb'
# mail client class class MailClient - HOST = (ENV.key?('MAIL_HOST') ? ENV['MAIL_HOST'] : MAIL_HOST) - PORT = (ENV.key?('MAIL_PORT') ? ENV['MAIL_PORT'] : MAIL_PORT).to_i + HOST = (ENV.key?('SEND_MAIL_HOST') ? ENV['SEND_MAIL_HOST'] : SEND_MAIL_HOST) + PORT = (ENV.key?('SEND_MAIL_PORT') ? ENV['SEND_MAIL_PORT'] : SEND_MAIL_PORT).to_i def initialize(host = HOST, port = PORT) @host = host @port = port