From 83667d8e14e6d4c9bfae3f231a08153176dd8473 Mon Sep 17 00:00:00 2001 From: keke <243768648@qq.com> Date: Mon, 15 Jul 2024 17:30:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=9A=E8=BF=87docker=E6=9E=84?= =?UTF-8?q?=E5=BB=BAdeb=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 ++++++++ build-on-gitee.sh | 6 ++++++ buildPkgInDocker.sh | 11 +++++++++++ dpkg-buildpackage.sh | 3 ++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100755 buildPkgInDocker.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee40409 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM docker.io/debian:10 + +RUN mkdir -p /a + +COPY . /a + +CMD ["/bin/cd", "/a"] +CMD ["/bin/bash", "/a/build-on-gitee.sh"] diff --git a/build-on-gitee.sh b/build-on-gitee.sh index cd10e79..2bb0ed5 100755 --- a/build-on-gitee.sh +++ b/build-on-gitee.sh @@ -1,6 +1,9 @@ # 换源 +pwd echo "换源" sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list +sed -i 's/deb http:\/\/security.debian.org/#deb http:\/\/security.debian.org/g' /etc/apt/sources.list + apt-get update export DEBIAN_FRONTEND=noninteractive echo "安装依赖..." @@ -22,3 +25,6 @@ for f in ${output_file_path_list} do mv $f ../target done + +echo "target:" +ls ../target diff --git a/buildPkgInDocker.sh b/buildPkgInDocker.sh new file mode 100755 index 0000000..935d39f --- /dev/null +++ b/buildPkgInDocker.sh @@ -0,0 +1,11 @@ +# 确保 已经配置好docker + +docker rm ccc +docker rmi -f ccc-app-manager + +docker build -t ccc-app-manager . +docker run -i --name=ccc -w /a ccc-app-manager +docker cp ccc:/target ../ + +docker rm ccc +docker rmi -f ccc-app-manager diff --git a/dpkg-buildpackage.sh b/dpkg-buildpackage.sh index 8650770..7292cad 100755 --- a/dpkg-buildpackage.sh +++ b/dpkg-buildpackage.sh @@ -3,6 +3,7 @@ # 获取版本号 if [[ "" == $version ]] || [[ "\n" == $version ]] then + echo "请输入版本号:" read -p "version: " version fi @@ -25,4 +26,4 @@ sed -i "s/\ \"version\":.*/\ \"version\": $version,/g" debian/deepin_pkg_info/in dpkg-buildpackage -us -uc cd .. -rm -rf dpkg-build-tmp \ No newline at end of file +rm -rf dpkg-build-tmp -- Gitee