代码拉取完成,页面将自动刷新
同步操作将从 Discuz/discuz_build_script 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash -e
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
echo "Illegal number of parameters"
exit 1
fi
TAG=$1
DRY_RUN=""
[ "$#" -eq 2 ] && DRY_RUN=$2
echo "---- Build Discuz Q Docker Image -----------------------------"
[ "$DRY_RUN" = "-n" ] && echo "Dry run, no changes will be pushed to remote"
BASE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $BASE
function check_discuz {
cd $BASE
if [ -d dzfull_temp ]; then
echo "---- dzfull_temp exists"
else
./build_vendor $TAG -n
fi
}
function move_dz_into_docker {
rm -rf $BASE/dzq-docker/root/var/www/discuz/*
rm -rf $BASE/dzq-docker-no-db/root/var/www/discuz/*
rm -f $BASE/dzfull_temp/*.zip
mkdir -p $BASE/dzq-docker/root/var/www/discuz/
cp -r $BASE/dzfull_temp/* $BASE/dzq-docker/root/var/www/discuz/
mkdir -p $BASE/dzq-docker-no-db/root/var/www/discuz/
mv $BASE/dzfull_temp/* $BASE/dzq-docker-no-db/root/var/www/discuz/
rm -rf $BASE/dzfull_temp
}
function build_docker {
cd $BASE/dzq-docker
docker build -t tencent/dzq:$TAG .
cd $BASE/dzq-docker-no-db
curl https://discuzq-docs-1258344699.cos.ap-guangzhou.myqcloud.com/setup.php -o root/usr/sbin/setup.php
rm -f root/usr/sbin/linux_stargate_installer
rm -f root/usr/sbin/cfs_barad_plugin_installer_release_v11
docker build -t tencent/dzq-no-db:$TAG .
}
function push_docker {
if [ "$DRY_RUN" = "-n" ]; then
echo "---- Dry run, won't upload to ccr"
elif [ "$DRY_RUN" = "-p" ]; then
echo "---- uploading without latest tag"
# 登录社区共有镜像仓库
docker login 镜像仓库
docker tag xxx:$TAG 镜像仓库/discuzq/dzq:$TAG
docker push 镜像仓库/discuzq/dzq:$TAG
docker tag tencent/dzq-no-db:$TAG 镜像仓库/discuzq/dzq-no-db:$TAG
docker push 镜像仓库/discuzq/dzq-no-db:$TAG
else
echo "---- uploading to registry.discuz.chat"
docker login 镜像仓库
docker tag tencent/dzq:$TAG 镜像仓库/discuzq/dzq:$TAG
docker push 镜像仓库/discuzq/dzq:$TAG
docker tag tencent/dzq:$TAG 镜像仓库/discuzq/dzq:latest
docker push 镜像仓库/discuzq/dzq:latest
docker tag tencent/dzq-no-db:$TAG 镜像仓库/discuzq/dzq-no-db:$TAG
docker push 镜像仓库/discuzq/dzq-no-db:$TAG
docker tag tencent/dzq-no-db:$TAG 镜像仓库/discuzq/dzq-no-db:latest
docker push 镜像仓库/discuzq/dzq-no-db:latest
fi
}
if [ "$DRY_RUN" = "-r" ]; then
echo "---- rebuilding docker image only"
build_docker
push_docker
else
check_discuz
move_dz_into_docker
build_docker
push_docker
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。