[PATCH v6 compass-ci 5/6] container/mail-robot: start file

Signed-off-by: Luan Shengde <luanshengde2@huawei.com> --- container/mail-robot/start | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 container/mail-robot/start diff --git a/container/mail-robot/start b/container/mail-robot/start new file mode 100755 index 0000000..a2e183d --- /dev/null +++ b/container/mail-robot/start @@ -0,0 +1,29 @@ +#!/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_relative '../defconfig.rb' +docker_rm 'mail-robot' + +JUMPER_IP = '192.168.132.2' +JUMPER_PORT = '29999' +SEND_MAIL_PORT = '11311' + +cmd = %W[ + docker run + --restart=always + --name=mail-robot + -d + -e JUMPER_IP=#{JUMPER_IP} + -e JUMPER_PORT=#{JUMPER_PORT} + -e SEND_MAIL_PORT=#{SEND_MAIL_PORT} + -v /c/upstream-repos:/upstream-repos:ro + -v /srv/cci/Maildir:/Maildir:rw + -v /c/compass-ci:/compass-ci:ro + mail-robot +] + +cmd += ['bash', '-c', 'umask 002 && ruby ./mail-robot.rb'] + +system(*cmd) -- 2.23.0

On Tue, Oct 13, 2020 at 09:23:20AM +0800, Luan Shengde wrote:
Signed-off-by: Luan Shengde <luanshengde2@huawei.com> --- container/mail-robot/start | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 container/mail-robot/start
diff --git a/container/mail-robot/start b/container/mail-robot/start new file mode 100755 index 0000000..a2e183d --- /dev/null +++ b/container/mail-robot/start @@ -0,0 +1,29 @@ +#!/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_relative '../defconfig.rb'
Blank line here. Have you run rubocop?
+docker_rm 'mail-robot' + +JUMPER_IP = '192.168.132.2'
IP => HOST
+JUMPER_PORT = '29999' +SEND_MAIL_PORT = '11311'
Load from defaults? container/assign-account/answerback-email.rb:56:SEND_MAIL_PORT = defaults['SEND_MAIL_PORT']
+cmd = %W[ + docker run + --restart=always + --name=mail-robot + -d + -e JUMPER_IP=#{JUMPER_IP} + -e JUMPER_PORT=#{JUMPER_PORT} + -e SEND_MAIL_PORT=#{SEND_MAIL_PORT}
+ -v /c/upstream-repos:/upstream-repos:ro + -v /srv/cci/Maildir:/Maildir:rw + -v /c/compass-ci:/compass-ci:ro
Please keep same dir name for consistency.
+ mail-robot +] + +cmd += ['bash', '-c', 'umask 002 && ruby ./mail-robot.rb']
Set umask in ruby script?
+ +system(*cmd) -- 2.23.0

On Wed, Oct 14, 2020 at 10:28:02AM +0800, Wu Fengguang wrote:
On Tue, Oct 13, 2020 at 09:23:20AM +0800, Luan Shengde wrote:
+require_relative '../defconfig.rb'
Blank line here. Have you run rubocop?
Yes I have run and returns no offenses detected I will add blank line here
+docker_rm 'mail-robot' + +JUMPER_IP = '192.168.132.2'
IP => HOST
I got it
+JUMPER_PORT = '29999' +SEND_MAIL_PORT = '11311'
Load from defaults?
container/assign-account/answerback-email.rb:56:SEND_MAIL_PORT = defaults['SEND_MAIL_PORT']
I got it and will optimize it.
+cmd = %W[ + docker run + --restart=always + --name=mail-robot + -d + -e JUMPER_IP=#{JUMPER_IP} + -e JUMPER_PORT=#{JUMPER_PORT} + -e SEND_MAIL_PORT=#{SEND_MAIL_PORT}
+ -v /c/upstream-repos:/upstream-repos:ro + -v /srv/cci/Maildir:/Maildir:rw + -v /c/compass-ci:/compass-ci:ro
Please keep same dir name for consistency.
do you mean? -v /c/upstream-repos:/c/upstream-repos:ro -v /srv/cci/Maildir:/srv/cci/Maildir:rw -v /c/compass-ci:/c/compass-ci:ro
+ mail-robot +] + +cmd += ['bash', '-c', 'umask 002 && ruby ./mail-robot.rb']
Set umask in ruby script?
I will optimize it Thanks Luan Shengde
+ +system(*cmd) -- 2.23.0

+ -v /c/upstream-repos:/upstream-repos:ro + -v /srv/cci/Maildir:/Maildir:rw + -v /c/compass-ci:/compass-ci:ro
Please keep same dir name for consistency.
do you mean?
-v /c/upstream-repos:/c/upstream-repos:ro -v /srv/cci/Maildir:/srv/cci/Maildir:rw -v /c/compass-ci:/c/compass-ci:ro
Right. Thanks, Fengguang
participants (2)
-
Luan Shengde
-
Wu Fengguang