克隆仓库增加 depth

This commit is contained in:
whyour 2023-04-24 14:46:13 +08:00
parent b705ad6ee8
commit 9a3e38051d
2 changed files with 5 additions and 5 deletions

View File

@ -56,12 +56,12 @@ RUN set -x \
&& rm -rf /root/.npm && rm -rf /root/.npm
ARG SOURCE_COMMIT ARG SOURCE_COMMIT
RUN git clone -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \ RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \
&& cd ${QL_DIR} \ && cd ${QL_DIR} \
&& cp -f .env.example .env \ && cp -f .env.example .env \
&& chmod 777 ${QL_DIR}/shell/*.sh \ && chmod 777 ${QL_DIR}/shell/*.sh \
&& chmod 777 ${QL_DIR}/docker/*.sh \ && chmod 777 ${QL_DIR}/docker/*.sh \
&& git clone -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static \ && git clone --depth=1 -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static \
&& mkdir -p ${QL_DIR}/static \ && mkdir -p ${QL_DIR}/static \
&& cp -rf /static/* ${QL_DIR}/static \ && cp -rf /static/* ${QL_DIR}/static \
&& rm -rf /static && rm -rf /static

View File

@ -315,7 +315,7 @@ git_clone_scripts() {
echo -e "开始克隆仓库 $url$dir\n" echo -e "开始克隆仓库 $url$dir\n"
set_proxy "$proxy" set_proxy "$proxy"
git clone $part_cmd $url $dir git clone --depth=1 $part_cmd $url $dir
exit_status=$? exit_status=$?
unset_proxy unset_proxy
} }
@ -329,8 +329,8 @@ git_pull_scripts() {
echo -e "开始更新仓库:$dir_work" echo -e "开始更新仓库:$dir_work"
set_proxy "$proxy" set_proxy "$proxy"
git fetch --all git fetch --depth=1 --all
git pull 1>/dev/null git pull --depth=1 1>/dev/null
exit_status=$? exit_status=$?
unset_proxy unset_proxy