Signed-off-by: Li Yuanchao lyc163mail@163.com --- container/auto-submit/Dockerfile | 15 +++++++++++++++ container/auto-submit/build | 6 ++++++ container/auto-submit/start | 30 +++++++++++++++++++++++++++++ container/auto-submit/start-depends | 1 + 4 files changed, 52 insertions(+) create mode 100644 container/auto-submit/Dockerfile create mode 100755 container/auto-submit/build create mode 100755 container/auto-submit/start create mode 100755 container/auto-submit/start-depends
diff --git a/container/auto-submit/Dockerfile b/container/auto-submit/Dockerfile new file mode 100644 index 0000000..16b3593 --- /dev/null +++ b/container/auto-submit/Dockerfile @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +FROM alpine:3.11 + +RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweicloud.com%7Cg' /etc/apk/repositories + +RUN apk update && \ + echo ':sources: ["http://rubygems.org"]' >> ~/.gemrc && \ + apk upgrade && \ + apk add --no-cache git && \ + apk add ruby-dev make gcc g++ + +RUN umask 002 && \ + gem install bunny json activesupport git rest-client diff --git a/container/auto-submit/build b/container/auto-submit/build new file mode 100755 index 0000000..3ae6b78 --- /dev/null +++ b/container/auto-submit/build @@ -0,0 +1,6 @@ +#!/bin/sh +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +docker build -t alpine311:auto-submit . + diff --git a/container/auto-submit/start b/container/auto-submit/start new file mode 100755 index 0000000..d0a0978 --- /dev/null +++ b/container/auto-submit/start @@ -0,0 +1,30 @@ +#!/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_relative '../defconfig.rb' + +DOCKER_CCI = '/c/compass-ci' +DOCKER_LKP = '/c/lkp-tests' +docker_rm "auto-submit" + +cmd = %W[ + docker run + --restart=always + --name auto-submit + -u 1090:1090 + -d + -e CCI_SRC=#{DOCKER_CCI} + -e LKP_SRC=#{DOCKER_LKP} + -v #{ENV['CCI_SRC']}:#{DOCKER_CCI} + -v #{ENV['LKP_SRC']}:#{DOCKER_LKP} + -v /etc/localtime:/etc/localtime:ro + -v /etc/compass-ci/defaults:/etc/compass-ci/defaults:ro + -v /srv/git:/srv/git + -w /c/compass-ci/sbin + alpine311:auto-submit +] + +cmd += ['sh', '-c', 'umask 002 && ./auto_submit'] +system(*cmd) diff --git a/container/auto-submit/start-depends b/container/auto-submit/start-depends new file mode 100755 index 0000000..5232abf --- /dev/null +++ b/container/auto-submit/start-depends @@ -0,0 +1 @@ +rabbitmq