Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-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
赵啸非
sample-form-platform
Commits
f193a39c
Commit
f193a39c
authored
Nov 02, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置文件
parent
7eee09c3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
240 additions
and
14 deletions
+240
-14
assembly/assembly.xml
assembly/assembly.xml
+15
-2
sample-form-manager/pom.xml
sample-form-manager/pom.xml
+58
-11
sample-form-manager/src/main/bin/deploy.sh
sample-form-manager/src/main/bin/deploy.sh
+166
-0
sample-form-manager/src/main/bin/start.sh
sample-form-manager/src/main/bin/start.sh
+1
-1
No files found.
assembly/assembly.xml
View file @
f193a39c
...
...
@@ -9,19 +9,32 @@
<fileSets>
<fileSet>
<directory>
${project.parent.basedir}/dist/${project.parent.artifactId}/bin
</directory>
<directory>
target/bin
</directory>
<!-- <directory>src/main/bin</directory>-->
<outputDirectory>
bin
</outputDirectory>
<fileMode>
0755
</fileMode>
</fileSet>
<fileSet>
<!-- <directory>${project.parent.basedir}/dist/${project.parent.artifactId}/boot</directory>-->
<directory>
${project.parent.basedir}/dist/${project.parent.artifactId}/boot
</directory>
<outputDirectory>
boot
</outputDirectory>
<fileMode>
0755
</fileMode>
</fileSet>
<fileSet>
<directory>
${project.parent.basedir}/dist/${project.parent.artifactId}/db
</directory>
<!-- <directory>${project.parent.basedir}/dist/${project.parent.artifactId}/db</directory>-->
<directory>
./db
</directory>
<includes>
<include>
*.sql
</include>
</includes>
<outputDirectory>
db
</outputDirectory>
<fileMode>
0755
</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>
target/${project.artifactId}-${project.version}.jar
</source>
<outputDirectory>
boot
</outputDirectory>
</file>
</files>
</assembly>
\ No newline at end of file
sample-form-manager/pom.xml
View file @
f193a39c
...
...
@@ -42,7 +42,7 @@
<id>
test
</id>
<properties>
<profiles.active>
test
</profiles.active>
<profiles.server.port>
1700
1
</profiles.server.port>
<profiles.server.port>
1700
2
</profiles.server.port>
<profiles.queue.type>
rabbitmq
</profiles.queue.type>
<profiles.kafka.brokers>
192.168.0.251:9092
</profiles.kafka.brokers>
<profiles.rabbitmq.host>
192.168.0.98
</profiles.rabbitmq.host>
...
...
@@ -181,11 +181,6 @@
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<jvmArguments>
-Dfile.encoding=UTF-8
</jvmArguments>
<outputDirectory>
${project.parent.basedir}/dist/${project.parent.artifactId}/boot
</outputDirectory>
<layout>
ZIP
</layout>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
@@ -197,7 +192,59 @@
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-resources-plugin
</artifactId>
<executions>
<execution>
<id>
copy-bin
</id>
<phase>
package
</phase>
<goals>
<goal>
copy-resources
</goal>
</goals>
<configuration>
<encoding>
UTF-8
</encoding>
<outputDirectory>
target/bin
</outputDirectory>
<resources>
<resource>
<directory>
src/main/bin/
</directory>
<excludes>
<exclude>
deploy.sh
</exclude>
</excludes>
<filtering>
true
</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>
copy-deploy
</id>
<phase>
package
</phase>
<goals>
<goal>
copy-resources
</goal>
</goals>
<configuration>
<encoding>
UTF-8
</encoding>
<outputDirectory>
${project.parent.basedir}/dist/${project.parent.artifactId}/
</outputDirectory>
<resources>
<resource>
<directory>
src/main/bin
</directory>
<includes>
<include>
deploy.sh
</include>
</includes>
<filtering>
true
</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
...
...
@@ -237,7 +284,7 @@
</configuration>
</execution>
</executions>
</plugin
>
</plugin>--
>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
...
...
sample-form-manager/src/main/bin/deploy.sh
0 → 100644
View file @
f193a39c
#!/bin/sh
SHELL_NAME
=
$0
BASEDIR
=
$(
dirname
$0
)
BASEDIR
=
$(
(
cd
"
$BASEDIR
"
pwd
)
)
LOCK_FILE
=
"/tmp/deploy.lock"
# 时间变量
LOG_DATE
=
'date "+%Y-%m-%d"'
LOG_TIME
=
'date "+%H-%M-%S"'
PUBLISH_PATH
=
"/home/publish"
PROJECT_NAME
=
"@project.artifactId@"
PORT
=
"@profiles.server.port@"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
SERVICE_PATH
=
"/usr/lib/systemd/system"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
NGINX_CONF_PATH
=
"/etc/nginx/conf.d/"
NGINX_PORT
=
"11091"
#nginx服务对外访问端口
NGINX_SERVER_PATH
=
"/m/"
#nginx服务转发后端服务路径
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
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
()
{
LOGINFO
=
$1
echo
"
${
CDATE
}
${
CTIME
}
:
${
SHELL_NAME
}
:
${
LOGINFO
}
"
>>
${
SHELL_LOG
}
echo
${
LOGINFO
}
}
#清理目标
clear_deploy
()
{
SERVICE
=
$1
EXECPATH
=
$2
#清理后台自启服务
rm
-rf
${
SERVICE
}
#清理执行文件目录
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
()
{
SERVICE
=
$1
EXECPATH
=
$2
echo
""
>
${
SERVICE
}
echo
"[Unit]"
>>
${
SERVICE
}
echo
"Description=
${
PROJECT_NAME
}
"
>>
${
SERVICE
}
echo
"After=network.target"
>>
${
SERVICE
}
echo
""
>>
${
SERVICE
}
echo
"[Service]"
>>
${
SERVICE
}
echo
"Environment=
\"
JAVA_HOME=
$JAVA_HOME
\"
"
>>
${
SERVICE
}
echo
"Type=forking"
>>
${
SERVICE
}
echo
"ExecStart=
${
EXECPATH
}
/bin/start.sh"
>>
${
SERVICE
}
echo
"ExecStop=
${
EXECPATH
}
/bin/shutdown.sh"
>>
${
SERVICE
}
echo
"PrivateTmp=true"
>>
${
SERVICE
}
echo
""
>>
${
SERVICE
}
echo
"[Install]"
>>
${
SERVICE
}
echo
"WantedBy=multi-user.target"
>>
${
SERVICE
}
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
}
/dist;
index index.html index.htm;
}
location
${
NGINX_SERVER_PATH
}
{
proxy_pass http://127.0.0.1:
${
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 /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
start_service_and_nginx
()
{
systemctl
enable
${
PROJECT_NAME
}
systemctl daemon-reload
systemctl start
${
PROJECT_NAME
}
nginx
-t
nginx
-s
reload
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
"
}
#部署后台服务
project_deploy
()
{
writelog
"
${
PROJECT_NAME
}
_deploy"
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
writelog
"
${
PROJECT_NAME
}
_clear_finish"
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
build_service
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
build_nginx
start_service_and_nginx
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
}
#部署前台服务
project_ui_deploy
()
{
writelog
"
${
PROJECT_NAME
}
_ui_deploy"
}
#主函数
main
()
{
echo
"后台服务部署"
project_deploy
#deploy.sh与后台与前台压缩包位置一致
echo
"前端服务部署"
}
main
$1
sample-form-manager/src/main/bin/start.sh
View file @
f193a39c
...
...
@@ -60,7 +60,7 @@ exec "$JAVACMD" $JAVA_OPTS \
-Dapp
.port
=
"
$PORT
"
\
-Dbasedir
=
"
$BASEDIR
"
\
-Djava
.io.tmpdir
=
$TEMP_PATH
\
-agentlib
:jdwp
=
transport
=
dt_socket,server
=
y,suspend
=
n,address
=
15504
\
#
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15504 \
-jar
$MAIN_CLASS
\
>
/dev/null &
...
...
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