On Mon, Oct 26, 2020 at 04:56:32PM +0800, Luan Shengde wrote:
Signed-off-by: Luan Shengde luanshengde2@huawei.com
container/send-internet-mail/start | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 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..483f01a --- /dev/null +++ b/container/send-internet-mail/start @@ -0,0 +1,39 @@ +#!/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
- ROBOT_EMAIL_PASSWORD
- SEND_MAIL_PORT
+]
+defaults = relevant_defaults(names)
+defaults['CCI_SRC'] = '/c/compass-ci'
+env = docker_env(defaults)
+cmd = %W[
%W => %w
- docker run
- --restart=always
- --name=send-internet-mail
- -d
+] + env + %W[
- -p #{defaults['SEND_MAIL_PORT']}:#{defaults['SEND_MAIL_PORT']}
- -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
Need to add "--log-opt max-size=1g" to control the total number of logs.
Thanks, Zhende.
- send-internet-mail
+]
+cmd += ['ruby', 'send-internet-mail.rb']
+system(*cmd)
2.23.0