+#!/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