From 1493196b2f3f647c96e76a4a78a644364af6c98b Mon Sep 17 00:00:00 2001 From: Jiang Long Date: Fri, 8 Nov 2024 09:42:40 +0800 Subject: [PATCH] add start script (#41) --- .../pypi/watch_update_source/Dockerfile | 3 ++- .../pypi/watch_update_source/build_image.sh | 2 ++ .../watch_update_source/start_container.sh | 25 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 easypackages/pypi/watch_update_source/start_container.sh diff --git a/easypackages/pypi/watch_update_source/Dockerfile b/easypackages/pypi/watch_update_source/Dockerfile index e5e2bd0..9c935f7 100644 --- a/easypackages/pypi/watch_update_source/Dockerfile +++ b/easypackages/pypi/watch_update_source/Dockerfile @@ -15,7 +15,8 @@ RUN yum install -y git ruby rubygems make gcc diffutils util-linux lftp hostname && gem install rest-client \ && git clone https://gitee.com/compass-ci/lkp-tests.git \ && git clone https://ghp.ci/https://github.com/opensourceways/easypackages.git \ - && pip install schedule + && pip install schedule \ + && pip install requests WORKDIR /root/easypackages/easypackages/pypi/watch_update_source/src diff --git a/easypackages/pypi/watch_update_source/build_image.sh b/easypackages/pypi/watch_update_source/build_image.sh index 05a7907..3b34bfa 100644 --- a/easypackages/pypi/watch_update_source/build_image.sh +++ b/easypackages/pypi/watch_update_source/build_image.sh @@ -1,2 +1,4 @@ #!/bin/bash +# /usr/bin/docker build --no-cache -t openeuler-pypi-package-update:latest . +/usr/bin/docker build -t openeuler-pypi-package-update . diff --git a/easypackages/pypi/watch_update_source/start_container.sh b/easypackages/pypi/watch_update_source/start_container.sh new file mode 100644 index 0000000..6291374 --- /dev/null +++ b/easypackages/pypi/watch_update_source/start_container.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +CCI_SRC=/c/compass-ci + +# shellcheck disable=SC1091 +source $CCI_SRC/container/defconfig.sh + +docker_rm openeuler-pypi-package-update +load_cci_defaults + +load_service_authentication + +cmd=( + docker run + --name openeuler-pypi-package-update + -it + -d + -v /srv:/srv:ro #(挂载的submit执行job结果父目录,便于容器内查看执行结果) + -v "$HOME/.config:/root/.config:ro" #(挂载的当前账号的compassci账密信息,用于容器内submit提交job) + -v /etc/compass-ci:/etc/compass-ci:ro #固定不变 + -v /etc/localtime:/etc/localtime:ro #固定不变 + openeuler-pypi-package-update:latest #使用构建出来的镜像 +) + +"${cmd[@]}"