Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docker-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kunkka王辉
docker-test
Commits
aa6c5f80
Commit
aa6c5f80
authored
Oct 29, 2023
by
Kunkka王辉
😲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部署脚本优化
parent
310163a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
install.sh
install.sh
+12
-3
No files found.
install.sh
View file @
aa6c5f80
#!/bin/bash
# 获取本机ip 192 ip
HOST_IP
=
$(
hostname
-I
|
awk
'{for(i=1; i<NF;i++) {if($i ~/192.168/) { print $i; exit}}}'
)
# CRM_PORT,DWP_PORT,CRM_CLIENT_PORT
# CRM_PORT,DWP_PORT,CRM_CLIENT_PORT
CRM_ADMIN_PORT
CRM_PORT
=
8181
DWP_PORT
=
8118
CRM_CLIENT_PORT
=
8290
CRM_ADMIN_PORT
=
9191
check_port
()
{
if
[[
$1
=
~ ^[0-9]+
$
]]
;
then
if
[
$1
-lt
49152
]
&&
[
$1
-gt
1023
]
;
then
...
...
@@ -15,7 +16,7 @@ check_port() {
}
#是否使用默认端口
printf
"是否使用默认端口:CRM:
$CRM_PORT
,DWP:
$DWP_PORT
,CRM_CLIENT:
$CRM_CLIENT_PORT
:[Y/N] "
;
printf
"是否使用默认端口:CRM:
$CRM_PORT
,DWP:
$DWP_PORT
,CRM_CLIENT:
$CRM_CLIENT_PORT
,CRM_ADMIN_PORT=
$CRM_ADMIN_PORT
=9191
:[Y/N] "
;
read
x
;
if
[
$x
==
"N"
]
;
then
printf
"设置CRM_PORT【当前8181】:"
&&
read
CRM_PORT
...
...
@@ -26,6 +27,10 @@ if [ $x == "N" ]; then
printf
"设置CRM_CLIENT_PORT 【当前8290】:"
&&
read
CRM_CLIENT_PORT
check_port
$CRM_CLIENT_PORT
||
echo
"CRM_CLIENT_PORT必须是整数[1024-49152]"
||
exit
printf
"设置CRM_ADMIN_PORT 【当前9191】:"
&&
read
CRM_ADMIN_PORT
check_port
$CRM_ADMIN_PORT
||
echo
"CRM_ADMIN_PORT必须是整数[1024-49152]"
||
exit
fi
OS_IS_LINUX
=
'yes'
...
...
@@ -52,7 +57,7 @@ cat <<EOF
3. git
$GIT_YES
4. docker-compose/docker compose
$DOCKER_COMPOSE_YES
5. tar
$TAR_YES
6. 端口
$CRM_PORT
,
$DWP_PORT
,
$CRM_CLIENT_PORT
是否可用
$PORT_YES
6. 端口
$CRM_PORT
,
$DWP_PORT
,
$CRM_CLIENT_PORT
,
$CRM_ADMIN_PORT
是否可用
$PORT_YES
8. 本机IP
$HOST_IP
EOF
if
echo
"
$TAR_YES$GIT_YES$DOCKER_COMPOSE_YES$OS_IS_LINUX$DOCKER_YES$PORT_YES
"
|
grep
no
>
/dev/null
;
then
...
...
@@ -84,10 +89,12 @@ cd $CODE_DIR/crm
grep
-rlZ
192.168.11.163:8118 ./ | xargs
-0
sed
-i
"s/192.168.11.163:8118/
$HOST_IP
:
$DWP_PORT
/g"
grep
-rlZ
192.168.11.163:8181 ./ | xargs
-0
sed
-i
"s/192.168.11.163:8181/
$HOST_IP
:
$CRM_PORT
/g"
grep
-rlZ
192.168.11.163:8290 ./ | xargs
-0
sed
-i
"s/192.168.11.163:8290/
$HOST_IP
:
$CRM_CLIENT_PORT
/g"
grep
-rlZ
192.168.11.163:9191 ./ | xargs
-0
sed
-i
"s/192.168.11.163:9191/
$HOST_IP
:
$CRM_ADMIN_PORT
/g"
cd
$CODE_DIR
/dwp/main
grep
-rlZ
192.168.11.163:8118 ./ | xargs
-0
sed
-i
"s/192.168.11.163:8118/
$HOST_IP
:
$DWP_PORT
/g"
grep
-rlZ
192.168.11.163:8181 ./ | xargs
-0
sed
-i
"s/192.168.11.163:8181/
$HOST_IP
:
$CRM_PORT
/g"
grep
-rlZ
192.168.11.163:8290 ./ | xargs
-0
sed
-i
"s/192.168.11.163:8290/
$HOST_IP
:
$CRM_CLIENT_PORT
/g"
grep
-rlZ
192.168.11.163:9191 ./ | xargs
-0
sed
-i
"s/192.168.11.163:9191/
$HOST_IP
:
$CRM_ADMIN_PORT
/g"
cd
$CODE_DIR
/../
git clone http://gitlab.galaxy-immi.com/kunkka.wh/docker-test.git
$BUILD_DIR
...
...
@@ -99,6 +106,7 @@ ENV=$ENV
PORT=
$DWP_PORT
PORT_CRM=
$CRM_PORT
PORT_CRM_CLIENT=
$CRM_CLIENT_PORT
CRM_ADMIN_PORT=
$CRM_ADMIN_PORT
# 代码目录,含前后端
CODE_DIR=
$CODE_DIR
JAVA_PROFILE=innerdev # java需要根据环境调整
...
...
@@ -114,5 +122,6 @@ cat <<EOF
本地访问地址
http://
$HOST_IP
:
$DWP_PORT
/ DWP
http://
$HOST_IP
:
$CRM_PORT
/ CRM
http://
$HOST_IP
:
$CRM_ADMIN_PORT
/ CRM-ADMIN
安装完成!
EOF
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment