On Wed, Jan 27, 2021 at 09:37:20PM +0800, Liu Shaofei wrote:
On Wed, Jan 27, 2021 at 08:48:42PM +0800, Cao Xueliang wrote:
Signed-off-by: Cao Xueliang caoxl78320@163.com
.../register-accounts}/register-accounts | 0 container/register-accounts/start | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+) rename {sparrow/5-build => container/register-accounts}/register-accounts (100%) create mode 100755 container/register-accounts/start
diff --git a/sparrow/5-build/register-accounts b/container/register-accounts/register-accounts similarity index 100% rename from sparrow/5-build/register-accounts rename to container/register-accounts/register-accounts diff --git a/container/register-accounts/start b/container/register-accounts/start new file mode 100755 index 0000000..36042b3 --- /dev/null +++ b/container/register-accounts/start @@ -0,0 +1,36 @@ +#!/usr/bin/env ruby +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true
you should use shell shebang.
This is a ruby script, why use that?
Thanks, Xueliang
#!/bin/bash
Thanks, Liushaofei
+require 'set' +require_relative '../defconfig.rb'
+names = Set.new %w[
- ES_HOST
- ES_PORT
+]
+defaults = relevant_defaults(names) +env = docker_env(defaults)
+DEFAULT_CCI = '/c/compass-ci' +docker_rm 'register-accounts'
+cmd = %w[
- docker run
- --name register-accounts
- -d
- --rm
+] + env + %W[
- -e CCI_SRC=#{DEFAULT_CCI}
- -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI}
- -v /etc/compass-ci/register:/etc/compass-ci/register:ro
- -v /etc/localtime:/etc/localtime:ro
- -w #{DEFAULT_CCI}/container/register-accounts
- register-accounts
+]
+cmd += ['sh', '-c', 'umask 002 && ./register-accounts']
+system(*cmd)
2.23.0