Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
install
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
LaunchDeploy
install
Commits
196b866f
提交
196b866f
authored
11月 13, 2025
作者:
Andy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
33
上级
e5388274
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
213 行增加
和
0 行删除
+213
-0
0100_IndiaPlat_Dev.sh
0100_IndiaPlat_Dev.sh
+213
-0
没有找到文件。
0100_IndiaPlat_Dev.sh
0 → 100755
浏览文件 @
196b866f
#!/bin/bash
###################################################
# 安装路径
Install_Dir
=
"/home/deploy/indiaplat"
# 平台名
GamePlatName
=
0100_IndiaPlat_Dev
# 分支
PlatSvr_Ranch
=
0100_IndiaPlat_Dev
PlatWeb_Ranch
=
0100_IndiaPlat_Dev
GameSvr_Ranch
=
0100_IndiaPlat_Dev
GameWeb_Ranch
=
0100_IndiaPlat_Dev
# git 地址
Git_PlatAddr
=
git.wkwork.xyz:LaunchDeploy
# git 路径
Git_ScriptAddr
=
git.wkwork.xyz/LaunchDeploy
###################################################
# 脚本地址前缀
Fun_Script_Url_Path
=
http://oauth2:QFF_7BNyjHsq_Zvfsfut@
$Git_ScriptAddr
/install/raw/master
PlatSvr_Repo_Url
=
"git@
$Git_PlatAddr
/wk_indiaplat_svr.git"
PlatSvr_Base_Dir
=
"./platsvr"
PlatSvr_Branches
=(
$PlatSvr_Ranch
)
PlatWeb_Repo_Url
=
"git@
$Git_PlatAddr
/wk_indiaplat_web.git"
PlatWeb_Base_Dir
=
"./platweb"
PlatWeb_Branches
=(
$PlatWeb_Ranch
)
GameSvr_Repo_Url
=
"git@
$Git_PlatAddr
/wk_bdgame_svr.git"
GameSvr_Base_Dir
=
"./bdgamesvr"
GameSvr_Branches
=(
$GameSvr_Ranch
)
GameWeb_Repo_Url
=
"git@
$Git_PlatAddr
/wk_bdgame_web.git"
GameWeb_Base_Dir
=
"./bdgameweb"
GameWeb_Branches
=(
$GameWeb_Ranch
)
if
[
!
-d
"
$Install_Dir
"
]
;
then
mkdir
-p
"
$Install_Dir
"
fi
cd
$Install_Dir
echo_content
()
{
local
tmp_color
=
"
$1
"
# 颜色
local
tmp_text
=
"
$2
"
# 文本
local
tmp_opt
=
"
$3
"
# 第三个参数用于传 -n
local
tmp_echo_type
=
"echo -e"
[
"
$tmp_opt
"
=
"-n"
]
&&
tmp_echo_type
=
"echo -en"
case
"
$tmp_color
"
in
"red"
)
$tmp_echo_type
"
\0
33[31m
${
tmp_text
}
\0
33[0m"
;;
"green"
)
$tmp_echo_type
"
\0
33[32m
${
tmp_text
}
\0
33[0m"
;;
"yellow"
)
$tmp_echo_type
"
\0
33[33m
${
tmp_text
}
\0
33[0m"
;;
"blue"
)
$tmp_echo_type
"
\0
33[34m
${
tmp_text
}
\0
33[0m"
;;
"purple"
)
$tmp_echo_type
"
\0
33[35m
${
tmp_text
}
\0
33[0m"
;;
"skyBlue"
)
$tmp_echo_type
"
\0
33[36m
${
tmp_text
}
\0
33[0m"
;;
"white"
)
$tmp_echo_type
"
\0
33[37m
${
tmp_text
}
\0
33[0m"
;;
esac
}
check_install_deps
()
{
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_deps.sh
)
check_install_deps
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_deps.sh
)
check_install_docker
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_deps.sh
)
check_install_pm2
}
check_gitaccount
()
{
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_git.sh
)
check_gitaccount
}
fetch_git_platsvr
()
{
echo
$Fun_Script_Url_Path
echo
$PlatSvr_Repo_Url
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_git.sh
)
fetch_git
$PlatSvr_Repo_Url
$PlatSvr_Base_Dir
$PlatSvr_Branches
}
fetch_git_platweb
()
{
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_git.sh
)
fetch_git
$PlatWeb_Repo_Url
$PlatWeb_Base_Dir
$PlatWeb_Branches
}
fetch_git_gamesvr
()
{
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_git.sh
)
fetch_git
$GameSvr_Repo_Url
$GameSvr_Base_Dir
$GameSvr_Branches
}
fetch_git_gameweb
()
{
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_git.sh
)
fetch_git
$GameWeb_Repo_Url
$GameWeb_Base_Dir
$GameWeb_Branches
}
linux_docker
()
{
bash <
(
curl
-sSL
$Fun_Script_Url_Path
/fun_docker.sh
)
linux_docker
}
run_platsvr_docker
()
{
local
current_dir
=
$(
pwd
)
cd
$PlatSvr_Base_Dir
/
$PlatSvr_Ranch
/docker-base
||
exit
make up
cd
$current_dir
cd
$PlatSvr_Base_Dir
/
$PlatSvr_Ranch
/docker-proxy
||
exit
make up
cd
$current_dir
}
run_gamesvr_docker
()
{
local
current_dir
=
$(
pwd
)
# cd $GameSvr_Base_Dir/$GameSvr_Ranch/docker-game || exit
# make up
# cd $current_dir
# cd $GameSvr_Base_Dir/$GameSvr_Ranch/docker-proxy || exit
# make up
cd
$current_dir
}
run_service
()
{
local
current_dir
=
$(
pwd
)
cd
$PlatSvr_Base_Dir
/
$GameSvr_Ranch
/server
||
exit
make export_env
make start
cd
$current_dir
}
# ------------------ 数组定义菜单项 ------------------
Memu_Items
=(
"测试 Git 账户"
"获取 Plat Svr"
"获取 Plat Web"
# "获取 Game Svr"
# "获取 Game Web"
"运行 Plat Docker"
# "运行 Game Docker"
"运行 Server"
"Docker管理"
"结束"
)
# 每个编号对应一个函数(index 对齐 MENU_ITEMS)
Mennu_Actions
=(
"check_gitaccount"
"fetch_git_platsvr"
"fetch_git_platweb"
# "fetch_git_gamesvr"
# "fetch_git_gameweb"
"run_platsvr_docker"
# "run_gamesvr_docker"
"run_service"
"linux_docker"
"exit 0"
)
main
()
{
# ------------------ 主循环 ------------------
while
true
;
do
clear
echo_content
"skyBlue"
"============================"
echo_content
"red"
" 安装游戏平台(
$GamePlatName
) "
echo_content
"skyBlue"
"============================"
for
i
in
"
${
!Memu_Items[@]
}
"
;
do
# printf " %2d) %s\n" "$((i + 1))" "${Memu_Items[$i]}"
# echo_content "skyBlue" " $((i + 1))) ${Memu_Items[$i]}"
echo_content
"white"
"
$((
i
+
1
))
) "
-n
echo_content
"green"
"
${
Memu_Items
[
$i
]
}
"
done
echo_content
"skyBlue"
"============================"
echo_content
"skyBlue"
"请选择操作: "
-n
read
-r
choice
# 转为下标(减 1)
if
[[
"
$choice
"
=
~ ^[0-9]+
$
]]
&&
[
"
$choice
"
-ge
1
]
&&
[
"
$choice
"
-le
"
${#
Memu_Items
[@]
}
"
]
;
then
index
=
$((
choice
-
1
))
echo_content
"skyBlue"
">> 执行:
${
Memu_Items
[
$index
]
}
"
eval
"
${
Mennu_Actions
[
$index
]
}
"
else
echo_content
"skyBlue"
"无效选择。"
fi
echo_content
"yellow"
"按任意键继续..."
-n
read
-n
1
-s
-r
echo
# 输入后换行(可选)
done
}
# ======= 安装默认工具 =======
check_install_deps
# ======= 启动程序 =======
main
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论