Signed-off-by: Li Ping 1477412247@qq.com --- container/rpm-repo/start | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 container/rpm-repo/start
diff --git a/container/rpm-repo/start b/container/rpm-repo/start new file mode 100755 index 0000000..3027855 --- /dev/null +++ b/container/rpm-repo/start @@ -0,0 +1,33 @@ +#!/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[ + MQ_HOST + LKP_SERVER +] + +defaults = relevant_defaults(names) +defaults['MQ_HOST'] ||= defaults['LKP_SERVER'] ||= '172.17.0.1' +defaults['LKP_SERVER'] ||= '172.17.0.1' +env = docker_env(defaults) + +docker_rm "update-repodata" + +cmd = %W[ + docker run + --restart=always + --name update-repodata + -u 1090:1090 +] + env + %W[ + -d + -v /etc/localtime:/etc/localtime:ro + -v /srv/rpm/:/srv/rpm/ + fedora:update-repodata +] + +system(*cmd)