Merge pull request #7263 from dataease/pr@v2_install_script

refactor: 优化安装脚本提示 #7247
This commit is contained in:
fit2cloudrd 2023-12-21 16:09:48 +08:00 committed by GitHub
commit b7542140ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 5 deletions

View File

@ -4,7 +4,6 @@ target=$2
DE_BASE=/opt
DE_RUNNING_BASE=${DE_BASE}/dataease2.0
DE_PORT=8100
need_init_apisix=false
compose_files="-f docker-compose.yml"
compose_cmd="docker-compose"

View File

@ -185,9 +185,6 @@ if [[ -d images ]]; then
docker load -i images/$i 2>&1 | tee -a ${CURRENT_DIR}/install.log
done
else
log "拉取镜像"
cd ${DE_RUN_BASE} && docker-compose $compose_files pull 2>&1
DEVERSION=$(cat ${CURRENT_DIR}/dataease/templates/version)
curl -sfL https://resource.fit2cloud.com/installation-log.sh | sh -s de ${INSTALL_TYPE} ${DEVERSION}
cd -
@ -244,5 +241,9 @@ log "启动服务"
dectl start | tee -a ${CURRENT_DIR}/install.log
dectl status 2>&1 | tee -a ${CURRENT_DIR}/install.log
access_port=$DE_PORT
if [[ $DE_INSTALL_MODE != "community" ]];then
access_port=9080
fi
echo -e "======================= 安装完成 =======================\n" 2>&1 | tee -a ${CURRENT_DIR}/install.log
echo -e "系统登录信息如下:\n 用户名: admin\n 初始密码: DataEase@123456" 2>&1 | tee -a ${CURRENT_DIR}/install.log
echo -e "系统登录信息如下:\n 访问地址: http://服务器IP:$access_port\n 用户名: admin\n 初始密码: DataEase@123456" 2>&1 | tee -a ${CURRENT_DIR}/install.log

41
installer/uninstall.sh Normal file
View File

@ -0,0 +1,41 @@
#!/bin/bash
DE_BASE=/opt
read -r -p "即将卸载 DataEase 服务,包括删除运行目录、数据及相关镜像,是否继续? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
;;
[nN][oO]|[nN])
echo "No"
exit 1
;;
*)
echo "无效输入..."
exit 1
;;
esac
if [ -f /usr/bin/dectl ]; then
# 获取已安装的 DataEase 的运行目录
DE_BASE=$(grep "^DE_BASE=" /usr/bin/dectl | cut -d'=' -f2)
fi
echo "停止 DataEase 服务"
dectl stop
# 清理 DataEase 相关镜像
if test ! -z "$(docker images -f dangling=true -q)"; then
echo "清理虚悬镜像"
docker rmi $(docker images -f dangling=true -q)
fi
if test -n "$(docker images | grep 'registry.cn-qingdao.aliyuncs.com/dataease')"; then
echo "清理 DataEase 镜像"
docker rmi $(docker images | grep "registry.cn-qingdao.aliyuncs.com/dataease" | awk -F' ' '{print $1":"$2}')
fi
# 清理 DataEase 运行目录及命令行工具 dectl
rm -rf ${DE_BASE}/dataease2.0 /usr/bin/dectl