Signed-off-by: Luan Shengde luanshengde2@huawei.com --- container/send-internet-mail/start | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 container/send-internet-mail/start
diff --git a/container/send-internet-mail/start b/container/send-internet-mail/start new file mode 100755 index 0000000..6ea55d6 --- /dev/null +++ b/container/send-internet-mail/start @@ -0,0 +1,42 @@ +#!/usr/bin/env ruby +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true + +require 'set' +require_relative '../defconfig' + +docker_rm 'send-internet-mail' + +names = Set.new %w[ + ROBOT_EMAIL_ADDRESS_INTERNET + ROBOT_EMAIL_PASSWORD_INTERNET + SEND_MAIL_PORT_INTERNET +] + +defaults = relevant_defaults(names) + +ROBOT_EMAIL_ADDRESS = defaults['ROBOT_EMAIL_ADDRESS_INTERNET'] +ROBOT_EMAIL_PASSWORD = defaults['ROBOT_EMAIL_PASSWORD_INTERNET'] +SEND_MAIL_PORT = defaults['SEND_MAIL_PORT_INTERNET'] + +cmd = %W[ + docker run + --restart=always + --name=send-internet-mail + -d + -e ROBOT_EMAIL_ADDRESS=#{ROBOT_EMAIL_ADDRESS} + -e ROBOT_EMAIL_PASSWORD=#{ROBOT_EMAIL_PASSWORD} + -e CCI_SRC=/c/compass-ci + -e SEND_MAIL_PORT=#{SEND_MAIL_PORT} + -p #{SEND_MAIL_PORT}:#{SEND_MAIL_PORT} + -v #{ENV['CCI_SRC']}:/c/compass-ci + -v /etc/localtime:/etc/localtime:ro + -w /c/compass-ci + --log-driver json-file + send-internet-mail +] + +cmd += ['ruby', "container/send-internet-mail/run.rb"] + +system(*cmd)
- ROBOT_EMAIL_ADDRESS_INTERNET
- ROBOT_EMAIL_PASSWORD_INTERNET
- SEND_MAIL_PORT_INTERNET
_INTERNET seems not suitable as *last part*. addr/passwd/port may be more suitable as last part.
How about removing _INTERNET?
For local email robot, prefix the vars with LOCAL_ like
LOCAL_SEND_MAIL_PORT
Thanks, Fengguang
On Mon, Oct 26, 2020 at 02:19:42PM +0800, Wu Fengguang wrote:
- ROBOT_EMAIL_ADDRESS_INTERNET
- ROBOT_EMAIL_PASSWORD_INTERNET
- SEND_MAIL_PORT_INTERNET
_INTERNET seems not suitable as *last part*. addr/passwd/port may be more suitable as last part.
How about removing _INTERNET?
For local email robot, prefix the vars with LOCAL_ like
LOCAL_SEND_MAIL_PORT
Of course it can be do like this I will fix it later
Thanks Luan Shengde
Thanks, Fengguang