Signed-off-by: Cao Xueliang caoxl78320@163.com --- .../register-accounts}/register-accounts | 1 + container/register-accounts/start | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) rename {sparrow/5-build => container/register-accounts}/register-accounts (98%) create mode 100755 container/register-accounts/start
diff --git a/sparrow/5-build/register-accounts b/container/register-accounts/register-accounts similarity index 98% rename from sparrow/5-build/register-accounts rename to container/register-accounts/register-accounts index 41126f9..ff69032 100755 --- a/sparrow/5-build/register-accounts +++ b/container/register-accounts/register-accounts @@ -12,3 +12,4 @@ content.each do |key, value| build_my_info = BuildMyInfo.new(value['my_email'], value['my_name'], ENV['lab']) build_my_info.store_account_info end +sleep diff --git a/container/register-accounts/start b/container/register-accounts/start new file mode 100755 index 0000000..b1ebe98 --- /dev/null +++ b/container/register-accounts/start @@ -0,0 +1,35 @@ +#!/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' + +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 +] + 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)