Mount '/srv/cci' and upload config to dir: 'libvirt-xml'. Use port 'ASSIST_CCI_PORT' or '11392' by default.
Signed-off-by: Ren Wen 15991987063@163.com --- container/assist-cci/build | 5 ++++ container/assist-cci/start | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100755 container/assist-cci/build create mode 100755 container/assist-cci/start
diff --git a/container/assist-cci/build b/container/assist-cci/build new file mode 100755 index 0000000..f82de7f --- /dev/null +++ b/container/assist-cci/build @@ -0,0 +1,5 @@ +#!/bin/sh +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +docker build -t assist-cci . diff --git a/container/assist-cci/start b/container/assist-cci/start new file mode 100755 index 0000000..b65f814 --- /dev/null +++ b/container/assist-cci/start @@ -0,0 +1,47 @@ +#!/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[ + ASSIST_CCI_HOST + ASSIST_CCI_PORT +] + +defaults = relevant_defaults(names) +env = docker_env(defaults) + +DEFAULT_LKP = '/c/lkp-tests' +DEFAULT_CCI = '/c/compass-ci' +DEFAULT_CONFIG_DIR = '/etc/compass-ci/defaults' +ASSIST_CCI_PORT = defaults['ASSIST_CCI_PORT'] || 11392 +SRV_CCI_PATH = '/srv/cci' +LIBVIRT_XML_PATH = "#{SRV_CCI_PATH}/libvirt-xml" +docker_rm 'assist-cci' + +cmd = %w[ + docker run + --name assist-cci + --restart=always + -d +] + env + %W[ + -e LIBVIRT_XML_PATH=#{LIBVIRT_XML_PATH} + -e ASSIST_CCI_PORT=#{ASSIST_CCI_PORT} + -e LKP_SRC=#{DEFAULT_LKP} + -e CCI_SRC=#{DEFAULT_CCI} + -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP} + -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI} + -v #{DEFAULT_CONFIG_DIR}:#{DEFAULT_CONFIG_DIR}:ro + -p #{ASSIST_CCI_PORT}:#{ASSIST_CCI_PORT} + -v /etc/localtime:/etc/localtime:ro + -v #{SRV_CCI_PATH}:#{SRV_CCI_PATH} + -w #{DEFAULT_CCI}/container/assist-cci/ + assist-cci +] + +cmd += ['sh', '-c', 'umask 002 && ruby ./routes.rb'] + +system(*cmd)
+#!/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[
- ASSIST_CCI_HOST
- ASSIST_CCI_PORT
+]
+defaults = relevant_defaults(names) +env = docker_env(defaults)
+DEFAULT_LKP = '/c/lkp-tests' +DEFAULT_CCI = '/c/compass-ci' +DEFAULT_CONFIG_DIR = '/etc/compass-ci/defaults' +ASSIST_CCI_PORT = defaults['ASSIST_CCI_PORT'] || 11392 +SRV_CCI_PATH = '/srv/cci' +LIBVIRT_XML_PATH = "#{SRV_CCI_PATH}/libvirt-xml" +docker_rm 'assist-cci'
+cmd = %w[
- docker run
- --name assist-cci
- --restart=always
- -d
+] + env + %W[
- -e LIBVIRT_XML_PATH=#{LIBVIRT_XML_PATH}
- -e ASSIST_CCI_PORT=#{ASSIST_CCI_PORT}
- -e LKP_SRC=#{DEFAULT_LKP}
- -e CCI_SRC=#{DEFAULT_CCI}
for you have used defaults = relevant_defaults(names) you can set: defaults['LIBVIRT_XML_PATH'] = '/srv/cci/libvirt-xml" ...
Thanks, Luan Shengde
- -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP}
- -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI}
- -v #{DEFAULT_CONFIG_DIR}:#{DEFAULT_CONFIG_DIR}:ro
- -p #{ASSIST_CCI_PORT}:#{ASSIST_CCI_PORT}
- -v /etc/localtime:/etc/localtime:ro
- -v #{SRV_CCI_PATH}:#{SRV_CCI_PATH}
- -w #{DEFAULT_CCI}/container/assist-cci/
- assist-cci
+]
+cmd += ['sh', '-c', 'umask 002 && ruby ./routes.rb']
+system(*cmd)
2.23.0
for you have used defaults = relevant_defaults(names) you can set: defaults['LIBVIRT_XML_PATH'] = '/srv/cci/libvirt-xml" ...
Got it.
Thanks, RenWen
Thanks, Luan Shengde
- -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP}
- -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI}
- -v #{DEFAULT_CONFIG_DIR}:#{DEFAULT_CONFIG_DIR}:ro
- -p #{ASSIST_CCI_PORT}:#{ASSIST_CCI_PORT}
- -v /etc/localtime:/etc/localtime:ro
- -v #{SRV_CCI_PATH}:#{SRV_CCI_PATH}
- -w #{DEFAULT_CCI}/container/assist-cci/
- assist-cci
+]
+cmd += ['sh', '-c', 'umask 002 && ruby ./routes.rb']
+system(*cmd)
2.23.0