Signed-off-by: Luan Shengde luanshengde2@huawei.com --- container/mail-robot/start | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 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..108ed83 --- /dev/null +++ b/container/mail-robot/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.rb' + +docker_rm 'mail-robot' + +names = Set.new %w[ + JUMPER_HOST + JUMPER_PORT + SEND_INTERNET_MAIL_PORT +] + +defaults = relevant_defaults(names) + +JUMPER_HOST = defaults['JUMPER_HOST'] +JUMPER_PORT = defaults['JUMPER_PORT'] +SEND_MAIL_PORT = defaults['SEND_INTERNET_MAIL_PORT'] + +cmd = %W[ + docker run + --restart=always + --name=mail-robot + -d + -e J_HOST=#{JUMPER_HOST} + -e J_PORT=#{JUMPER_PORT} + -e S_M_PORT=#{SEND_MAIL_PORT} + -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'] + +system(*cmd)
On Mon, Oct 19, 2020 at 02:57:31PM +0800, Luan Shengde wrote:
Signed-off-by: Luan Shengde luanshengde2@huawei.com
container/mail-robot/start | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 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..108ed83 --- /dev/null +++ b/container/mail-robot/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.rb'
+docker_rm 'mail-robot'
+names = Set.new %w[
- JUMPER_HOST
- JUMPER_PORT
- SEND_INTERNET_MAIL_PORT
+]
+defaults = relevant_defaults(names)
+JUMPER_HOST = defaults['JUMPER_HOST'] +JUMPER_PORT = defaults['JUMPER_PORT'] +SEND_MAIL_PORT = defaults['SEND_INTERNET_MAIL_PORT']
Avoid use-once vars.
+cmd = %W[
- docker run
- --restart=always
- --name=mail-robot
- -d
- -e J_HOST=#{JUMPER_HOST}
J_HOST... 一个东西两个名字, 搞什么鬼! 你是嫌项目不够难理解吗? 之前一再说明的规范, 忘哪里去了?!!
- -e J_PORT=#{JUMPER_PORT}
- -e S_M_PORT=#{SEND_MAIL_PORT}
- -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']
Can run umask in ruby script.
Thanks, Fengguang
On Mon, Oct 19, 2020 at 03:43:35PM +0800, Wu Fengguang wrote:
On Mon, Oct 19, 2020 at 02:57:31PM +0800, Luan Shengde wrote:
Signed-off-by: Luan Shengde luanshengde2@huawei.com
container/mail-robot/start | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 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..108ed83 --- /dev/null +++ b/container/mail-robot/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.rb'
+docker_rm 'mail-robot'
+names = Set.new %w[
- JUMPER_HOST
- JUMPER_PORT
- SEND_INTERNET_MAIL_PORT
+]
+defaults = relevant_defaults(names)
+JUMPER_HOST = defaults['JUMPER_HOST'] +JUMPER_PORT = defaults['JUMPER_PORT'] +SEND_MAIL_PORT = defaults['SEND_INTERNET_MAIL_PORT']
Avoid use-once vars.
+cmd = %W[
- docker run
- --restart=always
- --name=mail-robot
- -d
- -e J_HOST=#{JUMPER_HOST}
J_HOST... 一个东西两个名字, 搞什么鬼! 你是嫌项目不够难理解吗? 之前一再说明的规范, 忘哪里去了?!!
JUMPER_HOST will make the line too long I will fix it
- -e J_PORT=#{JUMPER_PORT}
- -e S_M_PORT=#{SEND_MAIL_PORT}
- -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']
Can run umask in ruby script.
I will fix it
Thanks Luan Shengde
Thanks, Fengguang