Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
679a45b2
Commit
679a45b2
authored
Jan 13, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/smart_gov_platform
parents
667403bc
1fdfb9ee
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
309 deletions
+33
-309
base-manager-ui/admin/.env.production
base-manager-ui/admin/.env.production
+5
-0
base-manager-ui/admin/.env.yibin
base-manager-ui/admin/.env.yibin
+4
-0
base-manager/pom.xml
base-manager/pom.xml
+1
-17
base-manager/src/main/bin/deploy.sh
base-manager/src/main/bin/deploy.sh
+6
-76
portal-manager-ui/admin/.env.yibin
portal-manager-ui/admin/.env.yibin
+1
-1
portal-manager/pom.xml
portal-manager/pom.xml
+2
-15
portal-manager/src/main/bin/deploy.sh
portal-manager/src/main/bin/deploy.sh
+7
-116
smart-gateway/src/main/bin/deploy.sh
smart-gateway/src/main/bin/deploy.sh
+7
-84
No files found.
base-manager-ui/admin/.env.production
0 → 100644
View file @
679a45b2
# 生产环境配置
NODE_ENV = production
VUE_APP_API_BASE_URL=/basics_api
VUE_APP_API_portal_URL=/portal_home
base-manager-ui/admin/.env.yibin
0 → 100644
View file @
679a45b2
#宜宾环境
NODE_ENV = "production"
VUE_APP_API_BASE_URL=/basics_api
VUE_APP_API_portal_URL=/portal_home
\ No newline at end of file
base-manager/pom.xml
View file @
679a45b2
...
@@ -25,10 +25,6 @@
...
@@ -25,10 +25,6 @@
</activation>
</activation>
<properties>
<properties>
<profiles.active>
develop
</profiles.active>
<profiles.active>
develop
</profiles.active>
<profiles.server.ip>
127.0.0.1
</profiles.server.ip>
<profiles.server.port>
17211
</profiles.server.port>
<profiles.nginx.port>
11071
</profiles.nginx.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
...
@@ -49,10 +45,6 @@
...
@@ -49,10 +45,6 @@
<id>
test
</id>
<id>
test
</id>
<properties>
<properties>
<profiles.active>
test
</profiles.active>
<profiles.active>
test
</profiles.active>
<profiles.server.ip>
192.168.0.98
</profiles.server.ip>
<profiles.server.port>
17211
</profiles.server.port>
<profiles.nginx.port>
11071
</profiles.nginx.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/base
</profiles.server.path>
<profiles.server.path>
/base
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
192.168.0.98
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
192.168.0.98
</profiles.rabbitmq.host>
...
@@ -73,10 +65,6 @@
...
@@ -73,10 +65,6 @@
<id>
product
</id>
<id>
product
</id>
<properties>
<properties>
<profiles.active>
test
</profiles.active>
<profiles.active>
test
</profiles.active>
<profiles.server.ip>
192.168.0.251
</profiles.server.ip>
<profiles.server.port>
17211
</profiles.server.port>
<profiles.nginx.port>
11071
</profiles.nginx.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/base
</profiles.server.path>
<profiles.server.path>
/base
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
192.168.0.251
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
192.168.0.251
</profiles.rabbitmq.host>
...
@@ -98,13 +86,9 @@
...
@@ -98,13 +86,9 @@
<id>
yibin
</id>
<id>
yibin
</id>
<properties>
<properties>
<profiles.active>
yibin
</profiles.active>
<profiles.active>
yibin
</profiles.active>
<profiles.server.ip>
192.168.2.144
</profiles.server.ip>
<profiles.server.port>
17211
</profiles.server.port>
<profiles.nginx.port>
11071
</profiles.nginx.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/base
</profiles.server.path>
<profiles.server.path>
/base
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
1
92.168.2.144
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
1
27.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
<profiles.rabbitmq.username>
taxi_mq
</profiles.rabbitmq.username>
<profiles.rabbitmq.username>
taxi_mq
</profiles.rabbitmq.username>
<profiles.rabbitmq.password>
admin@2020
</profiles.rabbitmq.password>
<profiles.rabbitmq.password>
admin@2020
</profiles.rabbitmq.password>
...
...
base-manager/src/main/bin/deploy.sh
View file @
679a45b2
...
@@ -10,35 +10,19 @@ LOCK_FILE="/tmp/deploy.lock"
...
@@ -10,35 +10,19 @@ LOCK_FILE="/tmp/deploy.lock"
# 时间变量
# 时间变量
CDATE
=
$(
date
"+%Y-%m-%d"
)
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
PUBLISH_PATH
=
"@profiles.publish.path@"
PROJECT_NAME
=
"@project.artifactId@"
IP
=
"@profiles.server.ip@"
PORT
=
"@profiles.server.port@"
GATEWAY_PORT
=
"@profiles.server.gatewayport@"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
SERVICE_PATH
=
"/usr/lib/systemd/system"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
SERVICE_PATH
=
"/usr/lib/systemd/system"
PUBLISH_PATH
=
"@profiles.publish.path@"
PROJECT_NAME
=
"@project.artifactId@"
NGINX_CONF_PATH
=
"/etc/nginx/conf.d/"
NGINX_PORT
=
"@profiles.nginx.port@"
NGINX_SERVER_PATH
=
"@profiles.server.path@"
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui/dist"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui/dist"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
PROJECT_UI_FILENAME
=
"
${
PROJECT_NAME
}
-ui.tar.gz"
PROJECT_UI_FILENAME
=
"
${
PROJECT_NAME
}
-ui.tar.gz"
PROJECT_SERVICE
=
"
${
SERVICE_PATH
}
/
${
PROJECT_NAME
}
.service"
PROJECT_SERVICE
=
"
${
SERVICE_PATH
}
/
${
PROJECT_NAME
}
.service"
PROJECT_NGINX_CONF
=
"
${
NGINX_CONF_PATH
}
/
${
PROJECT_NAME
}
.conf"
#加锁
shell_lock
()
{
touch
${
LOCK_FILE
}
}
#删除锁
shell_unlock
()
{
rm
-f
${
LOCK_FILE
}
}
#写日志
#写日志
writelog
()
{
writelog
()
{
LOGINFO
=
$1
LOGINFO
=
$1
...
@@ -54,9 +38,6 @@ clear_deploy() {
...
@@ -54,9 +38,6 @@ clear_deploy() {
rm
-rf
${
SERVICE
}
rm
-rf
${
SERVICE
}
#清理执行文件目录
#清理执行文件目录
rm
-rf
${
EXECPATH
}
rm
-rf
${
EXECPATH
}
#清理nginx服务配置文件
rm
-f
${
NGINX_CONF_PATH
}
/
${
PROJECT_NAME
}
.conf
mkdir
-p
${
EXECPATH
}
}
}
#清理ui
#清理ui
...
@@ -86,62 +67,14 @@ build_service() {
...
@@ -86,62 +67,14 @@ build_service() {
writelog
"
${
PROJECT_NAME
}
服务创建完成!"
writelog
"
${
PROJECT_NAME
}
服务创建完成!"
}
}
build_nginx
()
{
echo
"server{
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
#gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary off;
gzip_disable
\"
MSIE [1-6]
\.\"
;
listen
${
NGINX_PORT
}
;
#server_name localhost;
location / {
root
${
PROJECT_UI_EXECPATH
}
;
index index.html index.htm;
}
location
${
NGINX_SERVER_PATH
}
/ {
proxy_pass http://
${
IP
}
:
${
GATEWAY_PORT
}
;
proxy_set_header Host
\$
host;
proxy_set_header X-Real-IP
\$
remote_addr;
proxy_set_header X-Forwarded-For
\$
proxy_add_x_forwarded_for;
}
location /doc/ {
root
${
PROJECT_EXECPATH
}
;
index api.html;
}
location /file/fileupload/ {
alias /mortals/app/data/file/fileupload/;
autoindex on;
autoindex_exact_size off;
}
location /file/uploadfile/ {
alias /mortals/app/data/file/uploadfile/;
autoindex on;
autoindex_exact_size off;
}
location /file/preview/ {
alias /mortals/app/data/file/preview/;
autoindex on;
autoindex_exact_size off;
}
}
"
>
${
PROJECT_NGINX_CONF
}
}
#启动服务与nginx
#启动服务与nginx
start_service_and_nginx
()
{
start_service
()
{
writelog
"
${
PROJECT_NAME
}
服务启动..."
systemctl
enable
${
PROJECT_NAME
}
systemctl
enable
${
PROJECT_NAME
}
systemctl daemon-reload
systemctl daemon-reload
writelog
"
${
PROJECT_NAME
}
服务启动..."
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
project_status
=
$(
systemctl status
"
${
PROJECT_NAME
}
"
|grep Active |awk
'{print $2}'
)
project_status
=
$(
systemctl status
"
${
PROJECT_NAME
}
"
|grep Active |awk
'{print $2}'
)
nginx
-t
nginx
-s
reload
jcpid
=
$(
ps
-ef
|
grep
-v
"grep"
|
grep
"
${
PROJECT_NAME
}
"
|
awk
'{print $2}'
)
jcpid
=
$(
ps
-ef
|
grep
-v
"grep"
|
grep
"
${
PROJECT_NAME
}
"
|
awk
'{print $2}'
)
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
,status:
${
project_status
}
"
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
,status:
${
project_status
}
"
}
}
...
@@ -150,11 +83,8 @@ project_deploy() {
...
@@ -150,11 +83,8 @@ project_deploy() {
writelog
"
${
PROJECT_NAME
}
_deploy"
writelog
"
${
PROJECT_NAME
}
_deploy"
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
writelog
"
${
PROJECT_NAME
}
_clear_finish"
writelog
"
${
PROJECT_NAME
}
_clear_finish"
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
build_service
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
start_service
build_nginx
start_service_and_nginx
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
}
}
...
...
portal-manager-ui/admin/.env.yibin
View file @
679a45b2
#宜宾环境
#宜宾环境
NODE_ENV = "production"
NODE_ENV = "production"
VUE_APP_API_BASE_URL=http://192.168.3.24:11078
VUE_APP_API_BASE_URL=/basics_api
\ No newline at end of file
\ No newline at end of file
portal-manager/pom.xml
View file @
679a45b2
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
</activation>
</activation>
<properties>
<properties>
<profiles.active>
develop
</profiles.active>
<profiles.active>
develop
</profiles.active>
<profiles.server.port>
17212
</profiles.server.port>
<profiles.queue.type>
rabbitmq
</profiles.queue.type>
<profiles.queue.type>
rabbitmq
</profiles.queue.type>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
...
@@ -42,10 +41,6 @@
...
@@ -42,10 +41,6 @@
<id>
test
</id>
<id>
test
</id>
<properties>
<properties>
<profiles.active>
test
</profiles.active>
<profiles.active>
test
</profiles.active>
<profiles.server.ip>
192.168.0.98
</profiles.server.ip>
<profiles.server.port>
17212
</profiles.server.port>
<profiles.nginx.port>
11072
</profiles.nginx.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
192.168.0.98
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
192.168.0.98
</profiles.rabbitmq.host>
...
@@ -57,7 +52,7 @@
...
@@ -57,7 +52,7 @@
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.path>
/mortals/app/logs
</profiles.log.path>
<profiles.log.path>
/
home/
mortals/app/logs
</profiles.log.path>
<package.environment>
test
</package.environment>
<package.environment>
test
</package.environment>
<skipDeploy>
false
</skipDeploy>
<skipDeploy>
false
</skipDeploy>
</properties>
</properties>
...
@@ -66,10 +61,6 @@
...
@@ -66,10 +61,6 @@
<id>
product
</id>
<id>
product
</id>
<properties>
<properties>
<profiles.active>
product
</profiles.active>
<profiles.active>
product
</profiles.active>
<profiles.server.ip>
192.168.0.251
</profiles.server.ip>
<profiles.server.port>
17212
</profiles.server.port>
<profiles.nginx.port>
11072
</profiles.nginx.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
...
@@ -91,10 +82,6 @@
...
@@ -91,10 +82,6 @@
<id>
yibin
</id>
<id>
yibin
</id>
<properties>
<properties>
<profiles.active>
yibin
</profiles.active>
<profiles.active>
yibin
</profiles.active>
<profiles.server.ip>
192.168.2.144
</profiles.server.ip>
<profiles.server.port>
17212
</profiles.server.port>
<profiles.nginx.port>
11072
</profiles.nginx.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.server.path>
/zwfw
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
<profiles.rabbitmq.host>
127.0.0.1
</profiles.rabbitmq.host>
...
@@ -106,7 +93,7 @@
...
@@ -106,7 +93,7 @@
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.path>
/mortals/app/logs
</profiles.log.path>
<profiles.log.path>
/
home/
mortals/app/logs
</profiles.log.path>
<package.environment>
yibin
</package.environment>
<package.environment>
yibin
</package.environment>
<skipDeploy>
false
</skipDeploy>
<skipDeploy>
false
</skipDeploy>
</properties>
</properties>
...
...
portal-manager/src/main/bin/deploy.sh
View file @
679a45b2
...
@@ -10,40 +10,19 @@ LOCK_FILE="/tmp/deploy.lock"
...
@@ -10,40 +10,19 @@ LOCK_FILE="/tmp/deploy.lock"
# 时间变量
# 时间变量
CDATE
=
$(
date
"+%Y-%m-%d"
)
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
PUBLISH_PATH
=
"@profiles.publish.path@"
PROJECT_NAME
=
"@project.artifactId@"
IP
=
"@profiles.server.ip@"
PORT
=
"@profiles.server.port@"
GATEWAY_PORT
=
"@profiles.server.gatewayport@"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
MYSQL_HOST
=
"127.0.0.1"
MYSQL_PORT
=
"3306"
MYSQL_USER
=
"root"
MYSQL_PASSWORD
=
"xhx@2022"
SERVICE_PATH
=
"/usr/lib/systemd/system"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
SERVICE_PATH
=
"/usr/lib/systemd/system"
PUBLISH_PATH
=
"@profiles.publish.path@"
PROJECT_NAME
=
"@project.artifactId@"
NGINX_CONF_PATH
=
"/etc/nginx/conf.d/"
NGINX_PORT
=
"@profiles.nginx.port@"
NGINX_SERVER_PATH
=
"@profiles.server.path@"
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui/dist"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui/dist"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
PROJECT_UI_FILENAME
=
"
${
PROJECT_NAME
}
-ui.tar.gz"
PROJECT_UI_FILENAME
=
"
${
PROJECT_NAME
}
-ui.tar.gz"
PROJECT_SERVICE
=
"
${
SERVICE_PATH
}
/
${
PROJECT_NAME
}
.service"
PROJECT_SERVICE
=
"
${
SERVICE_PATH
}
/
${
PROJECT_NAME
}
.service"
PROJECT_NGINX_CONF
=
"
${
NGINX_CONF_PATH
}
/
${
PROJECT_NAME
}
.conf"
#加锁
shell_lock
()
{
touch
${
LOCK_FILE
}
}
#删除锁
shell_unlock
()
{
rm
-f
${
LOCK_FILE
}
}
#写日志
#写日志
writelog
()
{
writelog
()
{
LOGINFO
=
$1
LOGINFO
=
$1
...
@@ -59,9 +38,6 @@ clear_deploy() {
...
@@ -59,9 +38,6 @@ clear_deploy() {
rm
-rf
${
SERVICE
}
rm
-rf
${
SERVICE
}
#清理执行文件目录
#清理执行文件目录
rm
-rf
${
EXECPATH
}
rm
-rf
${
EXECPATH
}
#清理nginx服务配置文件
rm
-f
${
NGINX_CONF_PATH
}
/
${
PROJECT_NAME
}
.conf
mkdir
-p
${
EXECPATH
}
}
}
#清理ui
#清理ui
...
@@ -91,62 +67,14 @@ build_service() {
...
@@ -91,62 +67,14 @@ build_service() {
writelog
"
${
PROJECT_NAME
}
服务创建完成!"
writelog
"
${
PROJECT_NAME
}
服务创建完成!"
}
}
build_nginx
()
{
echo
"server{
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
#gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary off;
gzip_disable
\"
MSIE [1-6]
\.\"
;
listen
${
NGINX_PORT
}
;
#server_name localhost;
location / {
root
${
PROJECT_UI_EXECPATH
}
;
index index.html index.htm;
}
location
${
NGINX_SERVER_PATH
}
/ {
proxy_pass http://
${
IP
}
:
${
GATEWAY_PORT
}
;
proxy_set_header Host
\$
host;
proxy_set_header X-Real-IP
\$
remote_addr;
proxy_set_header X-Forwarded-For
\$
proxy_add_x_forwarded_for;
}
location /doc/ {
root
${
PROJECT_EXECPATH
}
;
index api.html;
}
location /file/fileupload/ {
alias /mortals/app/data/file/fileupload/;
autoindex on;
autoindex_exact_size off;
}
location /file/uploadfile/ {
alias /mortals/app/data/file/uploadfile/;
autoindex on;
autoindex_exact_size off;
}
location /file/preview/ {
alias /mortals/app/data/file/preview/;
autoindex on;
autoindex_exact_size off;
}
}
"
>
${
PROJECT_NGINX_CONF
}
}
#启动服务与nginx
#启动服务与nginx
start_service_and_nginx
()
{
start_service
()
{
writelog
"
${
PROJECT_NAME
}
服务启动..."
systemctl
enable
${
PROJECT_NAME
}
systemctl
enable
${
PROJECT_NAME
}
systemctl daemon-reload
systemctl daemon-reload
writelog
"
${
PROJECT_NAME
}
服务启动..."
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
project_status
=
$(
systemctl status
"
${
PROJECT_NAME
}
"
|
grep
Active |
awk
'{print $2}'
)
project_status
=
$(
systemctl status
"
${
PROJECT_NAME
}
"
|grep Active |awk
'{print $2}'
)
nginx
-t
nginx
-s
reload
jcpid
=
$(
ps
-ef
|
grep
-v
"grep"
|
grep
"
${
PROJECT_NAME
}
"
|
awk
'{print $2}'
)
jcpid
=
$(
ps
-ef
|
grep
-v
"grep"
|
grep
"
${
PROJECT_NAME
}
"
|
awk
'{print $2}'
)
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
,status:
${
project_status
}
"
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
,status:
${
project_status
}
"
}
}
...
@@ -155,11 +83,8 @@ project_deploy() {
...
@@ -155,11 +83,8 @@ project_deploy() {
writelog
"
${
PROJECT_NAME
}
_deploy"
writelog
"
${
PROJECT_NAME
}
_deploy"
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
writelog
"
${
PROJECT_NAME
}
_clear_finish"
writelog
"
${
PROJECT_NAME
}
_clear_finish"
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
build_service
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
start_service
build_nginx
start_service_and_nginx
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
}
}
...
@@ -169,13 +94,7 @@ project_ui_deploy() {
...
@@ -169,13 +94,7 @@ project_ui_deploy() {
clear_ui_deploy
${
PROJECT_UI_EXECPATH
}
clear_ui_deploy
${
PROJECT_UI_EXECPATH
}
tar
-zvxf
./
${
PROJECT_UI_FILENAME
}
-C
${
PUBLISH_PATH
}
tar
-zvxf
./
${
PROJECT_UI_FILENAME
}
-C
${
PUBLISH_PATH
}
writelog
"
${
PROJECT_NAME
}
_ui_deploy_finish"
writelog
"
${
PROJECT_NAME
}
_ui_deploy_finish"
}
init_db
()
{
writelog
"
${
PROJECT_NAME
}
_db_init"
mysql
-h
${
MYSQL_HOST
}
-P
${
MYSQL_PORT
}
-u
${
MYSQL_USER
}
-p
${
MYSQL_PASSWORD
}
<
${
EXECPATH
}
/db/db.sql
mysql
-h
${
MYSQL_HOST
}
-P
${
MYSQL_PORT
}
-u
${
MYSQL_USER
}
-p
${
MYSQL_PASSWORD
}
<
${
EXECPATH
}
/db/menu.sql
writelog
"
${
PROJECT_NAME
}
_db_init"
}
}
#主函数
#主函数
...
@@ -187,32 +106,4 @@ main() {
...
@@ -187,32 +106,4 @@ main() {
exit
${
RETVAL
}
exit
${
RETVAL
}
}
}
init_params
(){
#获取参数
while
getopts
h:P:u:p opt
;
do
case
$opt
in
h
)
#echo "-mysql-host ---- $OPTARG"
MYSQL_HOST
=
$OPTARG
;;
P
)
#echo "-mysql-port ---- $OPTARG"
MYSQL_PORT
=
$OPTARG
;;
u
)
#echo "-mysql-user ---- $OPTARG"
MYSQL_USER
=
$OPTARG
;;
p
)
#echo "-mysql-password ---- $OPTARG"
MYSQL_PASSWORD
=
$OPTARG
;;
?
)
echo
"
$opt
is an invalid option"
;;
esac
done
}
main
$1
main
$1
smart-gateway/src/main/bin/deploy.sh
View file @
679a45b2
...
@@ -10,34 +10,19 @@ LOCK_FILE="/tmp/deploy.lock"
...
@@ -10,34 +10,19 @@ LOCK_FILE="/tmp/deploy.lock"
# 时间变量
# 时间变量
CDATE
=
$(
date
"+%Y-%m-%d"
)
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
PUBLISH_PATH
=
"@profiles.publish.path@"
PROJECT_NAME
=
"@project.artifactId@"
IP
=
"@profiles.server.ip@"
PORT
=
"@profiles.server.port@"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
SERVICE_PATH
=
"/usr/lib/systemd/system"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
SERVICE_PATH
=
"/usr/lib/systemd/system"
PUBLISH_PATH
=
"@profiles.publish.path@"
PROJECT_NAME
=
"@project.artifactId@"
NGINX_CONF_PATH
=
"/etc/nginx/conf.d/"
NGINX_PORT
=
"@profiles.nginx.port@"
NGINX_SERVER_PATH
=
"@profiles.server.path@"
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui
/dist
"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
PROJECT_UI_FILENAME
=
"
${
PROJECT_NAME
}
-ui.tar.gz"
PROJECT_UI_FILENAME
=
"
${
PROJECT_NAME
}
-ui.tar.gz"
PROJECT_SERVICE
=
"
${
SERVICE_PATH
}
/
${
PROJECT_NAME
}
.service"
PROJECT_SERVICE
=
"
${
SERVICE_PATH
}
/
${
PROJECT_NAME
}
.service"
PROJECT_NGINX_CONF
=
"
${
NGINX_CONF_PATH
}
/
${
PROJECT_NAME
}
.conf"
#加锁
shell_lock
()
{
touch
${
LOCK_FILE
}
}
#删除锁
shell_unlock
()
{
rm
-f
${
LOCK_FILE
}
}
#写日志
#写日志
writelog
()
{
writelog
()
{
LOGINFO
=
$1
LOGINFO
=
$1
...
@@ -53,16 +38,6 @@ clear_deploy() {
...
@@ -53,16 +38,6 @@ clear_deploy() {
rm
-rf
${
SERVICE
}
rm
-rf
${
SERVICE
}
#清理执行文件目录
#清理执行文件目录
rm
-rf
${
EXECPATH
}
rm
-rf
${
EXECPATH
}
#清理nginx服务配置文件
rm
-f
${
NGINX_CONF_PATH
}
/
${
PROJECT_NAME
}
.conf
mkdir
-p
${
EXECPATH
}
}
#清理ui
clear_ui_deploy
()
{
EXEC_UI_PATH
=
$1
rm
-rf
${
EXEC_UI_PATH
}
mkdir
-p
${
EXEC_UI_PATH
}
}
}
build_service
()
{
build_service
()
{
...
@@ -85,59 +60,14 @@ build_service() {
...
@@ -85,59 +60,14 @@ build_service() {
writelog
"
${
PROJECT_NAME
}
服务创建完成!"
writelog
"
${
PROJECT_NAME
}
服务创建完成!"
}
}
build_nginx
()
{
echo
"server{
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
#gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary off;
gzip_disable
\"
MSIE [1-6]
\.\"
;
listen
${
NGINX_PORT
}
;
#server_name localhost;
location / {
proxy_pass http://
${
IP
}
:
${
PORT
}
;
proxy_set_header Host
\$
host;
proxy_set_header X-Real-IP
\$
remote_addr;
proxy_set_header X-Forwarded-For
\$
proxy_add_x_forwarded_for;
}
location /homeDeviceUrl/ {
alias /home/publish/device-manager-ui/homeDeviceUrl/;
index index.html index.htm;
}
location /file/fileupload/ {
alias /mortals/app/data/file/fileupload/;
autoindex on;
autoindex_exact_size off;
}
location /file/uploadfile/ {
alias /mortals/app/data/file/uploadfile/;
autoindex on;
autoindex_exact_size off;
}
location /file/preview/ {
alias /mortals/app/data/file/preview/;
autoindex on;
autoindex_exact_size off;
}
}
"
>
${
PROJECT_NGINX_CONF
}
}
#启动服务与nginx
#启动服务与nginx
start_service_and_nginx
()
{
start_service
()
{
writelog
"
${
PROJECT_NAME
}
服务启动..."
systemctl
enable
${
PROJECT_NAME
}
systemctl
enable
${
PROJECT_NAME
}
systemctl daemon-reload
systemctl daemon-reload
writelog
"
${
PROJECT_NAME
}
服务启动..."
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
project_status
=
$(
systemctl status
"
${
PROJECT_NAME
}
"
|grep Active |awk
'{print $2}'
)
project_status
=
$(
systemctl status
"
${
PROJECT_NAME
}
"
|grep Active |awk
'{print $2}'
)
nginx
-t
nginx
-s
reload
jcpid
=
$(
ps
-ef
|
grep
-v
"grep"
|
grep
"
${
PROJECT_NAME
}
"
|
awk
'{print $2}'
)
jcpid
=
$(
ps
-ef
|
grep
-v
"grep"
|
grep
"
${
PROJECT_NAME
}
"
|
awk
'{print $2}'
)
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
,status:
${
project_status
}
"
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
,status:
${
project_status
}
"
}
}
...
@@ -146,19 +76,12 @@ project_deploy() {
...
@@ -146,19 +76,12 @@ project_deploy() {
writelog
"
${
PROJECT_NAME
}
_deploy"
writelog
"
${
PROJECT_NAME
}
_deploy"
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
writelog
"
${
PROJECT_NAME
}
_clear_finish"
writelog
"
${
PROJECT_NAME
}
_clear_finish"
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
build_service
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
start_service
writelog
"
${
PROJECT_NAME
}
_deploy_build_nginx"
build_nginx
writelog
"
${
PROJECT_NAME
}
_deploy_build_nginx_finish"
writelog
"
${
PROJECT_NAME
}
_deploy_build_service_finish"
start_service_and_nginx
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
}
}
#主函数
#主函数
main
()
{
main
()
{
echo
"后台服务部署"
echo
"后台服务部署"
...
...
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