Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
appbuild
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
赵啸非
appbuild
Commits
4addb943
Commit
4addb943
authored
1 year ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加apipost生成接口文档逻辑
parent
c5c3cd9a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
497 additions
and
119 deletions
+497
-119
appbuild-manager/pom.xml
appbuild-manager/pom.xml
+213
-53
appbuild-manager/src/main/bin/deploy.sh
appbuild-manager/src/main/bin/deploy.sh
+111
-0
appbuild-manager/src/main/bin/shutdown.sh
appbuild-manager/src/main/bin/shutdown.sh
+15
-27
appbuild-manager/src/main/bin/start.sh
appbuild-manager/src/main/bin/start.sh
+12
-27
appbuild-manager/src/main/bin/stop.sh
appbuild-manager/src/main/bin/stop.sh
+52
-0
appbuild-manager/src/main/resources/logback-spring.xml
appbuild-manager/src/main/resources/logback-spring.xml
+36
-12
assembly/assembly-manager-ui.xml
assembly/assembly-manager-ui.xml
+22
-0
assembly/assembly.xml
assembly/assembly.xml
+36
-0
No files found.
appbuild-manager/pom.xml
View file @
4addb943
...
@@ -126,7 +126,167 @@
...
@@ -126,7 +126,167 @@
</dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-jar-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.19.1
</version>
<configuration>
<skipTests>
true
</skipTests>
<!--默认关掉单元测试 -->
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</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.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.codehaus.mojo
</groupId>
<artifactId>
exec-maven-plugin
</artifactId>
<version>
1.6.0
</version>
<executions>
<execution>
<id>
exec-npm-install
</id>
<phase>
generate-resources
</phase>
<goals>
<goal>
exec
</goal>
</goals>
<configuration>
<executable>
yarn
</executable>
<arguments>
<argument></argument>
</arguments>
<workingDirectory>
${project.parent.basedir}/appbuild-manage-ui/admin
</workingDirectory>
</configuration>
</execution>
<execution>
<id>
exec-npm-run-build
</id>
<phase>
generate-resources
</phase>
<goals>
<goal>
exec
</goal>
</goals>
<configuration>
<executable>
yarn
</executable>
<arguments>
<argument>
run
</argument>
<arguments>
build
</arguments>
</arguments>
<workingDirectory>
${project.parent.basedir}/appbuild-manage-ui/admin
</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.3.0
</version>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<finalName>
${project.artifactId}
</finalName>
<appendAssemblyId>
false
</appendAssemblyId>
<descriptors>
<descriptor>
../assembly/assembly.xml
</descriptor>
</descriptors>
<outputDirectory>
${project.parent.basedir}/dist/${project.artifactId}
</outputDirectory>
</configuration>
</execution>
<execution>
<id>
make-assembly-ui
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<finalName>
${project.artifactId}-ui
</finalName>
<appendAssemblyId>
false
</appendAssemblyId>
<descriptors>
<descriptor>
../assembly/assembly-manager-ui.xml
</descriptor>
</descriptors>
<outputDirectory>
${project.parent.basedir}/dist/${project.artifactId}
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!--
<build>
<build>
<resources>
<resources>
<resource>
<resource>
...
@@ -183,7 +343,7 @@
...
@@ -183,7 +343,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<version>2.19.1</version>
<configuration>
<configuration>
<skipTests>
true
</skipTests>
<!--默认关掉单元测试 -->
<skipTests>true</skipTests> <!–默认关掉单元测试 –>
</configuration>
</configuration>
</plugin>
</plugin>
<plugin>
<plugin>
...
@@ -193,7 +353,7 @@
...
@@ -193,7 +353,7 @@
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<outputDirectory>${project.parent.basedir}/dist/${project.parent.artifactId}/boot</outputDirectory>
<outputDirectory>${project.parent.basedir}/dist/${project.parent.artifactId}/boot</outputDirectory>
<layout>ZIP</layout>
<layout>ZIP</layout>
<!-- 打包时,本jar包不包含其他依赖包 , 否则打出的jar包还是很大 -->
<!– 打包时,本jar包不包含其他依赖包 , 否则打出的jar包还是很大 –>
</configuration>
</configuration>
</plugin>
</plugin>
<plugin>
<plugin>
...
@@ -230,6 +390,6 @@
...
@@ -230,6 +390,6 @@
</executions>
</executions>
</plugin>
</plugin>
</plugins>
</plugins>
</build
>
</build>--
>
</project>
</project>
This diff is collapsed.
Click to expand it.
appbuild-manager/src/main/bin/deploy.sh
0 → 100644
View file @
4addb943
#!/bin/sh
RETVAL
=
$?
SHELL_NAME
=
"deploy"
BASEDIR
=
$(
dirname
$0
)
BASEDIR
=
$(
(
cd
"
$BASEDIR
"
pwd
)
)
LOCK_FILE
=
"/tmp/deploy.lock"
# 时间变量
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
JAVA_HOME
=
"/usr/local/java/jdk1.8"
SERVICE_PATH
=
"/usr/lib/systemd/system"
PUBLISH_PATH
=
"@profiles.publish.path@"
PROJECT_NAME
=
"@project.artifactId@"
PROJECT_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
"
PROJECT_UI_EXECPATH
=
"
${
PUBLISH_PATH
}
/
${
PROJECT_NAME
}
-ui/dist"
PROJECT_FILENAME
=
"
${
PROJECT_NAME
}
.tar.gz"
PROJECT_UI_FILENAME
=
"
${
PROJECT_NAME
}
-ui.tar.gz"
PROJECT_SERVICE
=
"
${
SERVICE_PATH
}
/
${
PROJECT_NAME
}
.service"
#写日志
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
}
}
#清理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
}
服务创建完成!"
}
#启动服务与nginx
start_service
()
{
systemctl
enable
${
PROJECT_NAME
}
systemctl daemon-reload
writelog
"
${
PROJECT_NAME
}
服务启动..."
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
project_status
=
$(
systemctl status
"
${
PROJECT_NAME
}
"
|grep Active |awk
'{print $2}'
)
jcpid
=
$(
ps
-ef
|
grep
-v
"grep"
|
grep
"
${
PROJECT_NAME
}
"
|
awk
'{print $2}'
)
writelog
"
${
PROJECT_NAME
}
服务启动,PID is
${
jcpid
}
,status:
${
project_status
}
"
}
#部署后台服务
project_deploy
()
{
writelog
"
${
PROJECT_NAME
}
_deploy"
systemctl stop
${
PROJECT_NAME
}
clear_deploy
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
writelog
"
${
PROJECT_NAME
}
_clear_finish"
tar
-zvxf
./
${
PROJECT_FILENAME
}
-C
${
PUBLISH_PATH
}
build_service
${
PROJECT_SERVICE
}
${
PROJECT_EXECPATH
}
start_service
writelog
"
${
PROJECT_NAME
}
_deploy_finish"
}
#部署前台服务
project_ui_deploy
()
{
writelog
"
${
PROJECT_NAME
}
_ui_deploy"
clear_ui_deploy
${
PROJECT_UI_EXECPATH
}
tar
-zvxf
./
${
PROJECT_UI_FILENAME
}
-C
${
PUBLISH_PATH
}
writelog
"
${
PROJECT_NAME
}
_ui_deploy_finish"
}
#主函数
main
()
{
echo
"后台服务部署"
project_deploy
echo
"前端服务部署"
project_ui_deploy
exit
${
RETVAL
}
}
main
$1
This diff is collapsed.
Click to expand it.
appbuild-manager/src/main/bin/shutdown.sh
View file @
4addb943
#! /bin/sh
#! /bin/sh
PORT
=
"@profiles.server.port@"
PORT
=
"@profiles.server.port@"
BASEDIR
=
`
dirname
$0
`
BASEDIR
=
$(
dirname
$0
)
BASEDIR
=
`
(
cd
"
$BASEDIR
"
;
pwd
)
`
BASEDIR
=
$(
(
cd
"
$BASEDIR
"
pwd
)
)
PROJECT_NAME
=
"@project.artifactId@"
PROJECT_NAME
=
"@project.artifactId@"
MAIN_CLASS
=
"
$PROJECT_NAME
"
;
MAIN_CLASS
=
"
$PROJECT_NAME
"
SHELL_NAME
=
"shutdown"
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
#写日志
writelog
()
{
LOGINFO
=
$1
echo
"
${
CDATE
}
${
CTIME
}
:
${
SHELL_NAME
}
:
${
LOGINFO
}
"
>>
${
SHELL_LOG
}
echo
${
LOGINFO
}
}
if
[
!
-n
"
$PORT
"
]
;
then
if
[
!
-n
"
$PORT
"
]
;
then
writelog
$"Usage:
$0
{port}"
echo
$"Usage:
$0
{port}"
exit
9
exit
$FAIL
fi
fi
pid
=
$(
ps ax |
grep
-i
"
$MAIN_CLASS
"
|
grep
java |
grep
-v
grep
|
awk
'{print $1}'
)
pid
=
`
ps ax |
grep
-i
"
$MAIN_CLASS
"
|
grep
java |
grep
-v
grep
|
awk
'{print $1}'
`
if
[
-z
"
$pid
"
]
;
then
if
[
-z
"
$pid
"
]
;
then
echo
"No Server running."
writelog
"No Server running."
exit
1
exit
0
;
fi
fi
writelog
"stoping application
$PROJECT_NAME
......"
echo
"stoping application
$PROJECT_NAME
......"
kill
-15
${
pid
}
kill
-15
${
pid
}
writelog
"Send shutdown request to Server
$PROJECT_NAME
OK"
echo
"Send shutdown request to Server
$PROJECT_NAME
OK"
exit
0
;
This diff is collapsed.
Click to expand it.
appbuild-manager/src/main/bin/start.sh
View file @
4addb943
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
PORT
=
"@profiles.server.port@"
PORT
=
"@profiles.server.port@"
BASEDIR
=
`
dirname
$0
`
/..
BASEDIR
=
`
dirname
$0
`
/..
BASEDIR
=
`
(
cd
"
$BASEDIR
"
;
pwd
)
`
BASEDIR
=
`
(
cd
"
$BASEDIR
"
;
pwd
)
`
SHELL_NAME
=
"start"
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H:%M:%S"
)
PROJECT_NAME
=
"@project.artifactId@"
;
PROJECT_NAME
=
"@project.artifactId@"
;
MAIN_CLASS
=
"
$PROJECT_NAME
-@project.version@.jar"
;
MAIN_CLASS
=
"
$PROJECT_NAME
-@project.version@.jar"
;
LOG_PATH
=
"@profiles.log.path@/
$PROJECT_NAME
"
LOG_PATH
=
"@profiles.log.path@/
$PROJECT_NAME
"
...
@@ -12,20 +9,10 @@ GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log"
...
@@ -12,20 +9,10 @@ GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log"
HS_ERR_PATH
=
$LOG_PATH
/PROJECT_NAME
"-hs_err.log"
HS_ERR_PATH
=
$LOG_PATH
/PROJECT_NAME
"-hs_err.log"
HEAP_DUMP_PATH
=
$LOG_PATH
/PROJECT_NAME
"-heap_dump.hprof"
HEAP_DUMP_PATH
=
$LOG_PATH
/PROJECT_NAME
"-heap_dump.hprof"
TEMP_PATH
=
$LOG_PATH
/temp/
TEMP_PATH
=
$LOG_PATH
/temp/
SHELL_LOG
=
"
${
BASEDIR
}
/
${
SHELL_NAME
}
.log"
SUCCESS
=
0
SUCCESS
=
0
FAIL
=
9
FAIL
=
9
#写日志
writelog
()
{
LOGINFO
=
$1
echo
"
${
CDATE
}
${
CTIME
}
:
${
SHELL_NAME
}
:
${
LOGINFO
}
"
>>
${
SHELL_LOG
}
echo
${
LOGINFO
}
}
if
[
!
-n
"
$PORT
"
]
;
then
if
[
!
-n
"
$PORT
"
]
;
then
writelog
$"Usage:
$0
{port}"
echo
$"Usage:
$0
{port}"
exit
$FAIL
exit
$FAIL
fi
fi
if
[
!
-d
$LOG_PATH
]
;
if
[
!
-d
$LOG_PATH
]
;
...
@@ -36,31 +23,28 @@ if [ ! -d $TEMP_PATH ];
...
@@ -36,31 +23,28 @@ if [ ! -d $TEMP_PATH ];
then
then
mkdir
-p
$TEMP_PATH
;
mkdir
-p
$TEMP_PATH
;
fi
fi
#-z STRING 如果STRING的长度为零则为真 ,即判断是否为空,空即是真;
if
[
-z
"
$JAVACMD
"
]
;
then
if
[
-z
"
$JAVACMD
"
]
;
then
#-n STRING 如果STRING的长度非零则为真 ,即判断是否为非空,非空即是真;
if
[
-n
"
$JAVA_HOME
"
]
;
then
if
[
-n
"
$JAVA_HOME
"
]
;
then
#-x FILE 如果 FILE 存在且是可执行的则为真。
if
[
-x
"
$JAVA_HOME
/jre/sh/java"
]
;
then
if
[
-x
"
$JAVA_HOME
/jre/sh/java"
]
;
then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD
=
"
$JAVA_HOME
/jre/sh/java"
JAVACMD
=
"
$JAVA_HOME
/jre/sh/java"
else
else
JAVACMD
=
"
$JAVA_HOME
/bin/java"
JAVACMD
=
"
$JAVA_HOME
/bin/java"
fi
fi
else
else
JAVACMD
=
`
which java
`
JAVACMD
=
`
which java
`
writelog
"Error: JAVA_HOME is not defined correctly.
$JAVACMD
"
echo
"Error: JAVA_HOME is
$JAVACMD
"
#exit $ERR_NO_JAVA
fi
fi
fi
fi
#-x FILE 如果 FILE 存在且是可执行的则为真。
if
[
!
-x
"
$JAVACMD
"
]
;
then
if
[
!
-x
"
$JAVACMD
"
]
;
then
writelog
"We cannot execute
$JAVACMD
"
echo
"We cannot execute
$JAVACMD
"
exit
$ERR_NO_JAVA
exit
$ERR_NO_JAVA
fi
fi
if
[
-e
"
$BASEDIR
"
]
if
[
-e
"
$BASEDIR
"
]
then
then
JAVA_OPTS
=
"-Xms
1024M -Xmx2048
M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:
$GC_PATH
-XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=
$HS_ERR_PATH
-XX:HeapDumpPath=
$HEAP_DUMP_PATH
"
JAVA_OPTS
=
"-Xms
512M -Xmx1024
M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:
$GC_PATH
-XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=
$HS_ERR_PATH
-XX:HeapDumpPath=
$HEAP_DUMP_PATH
"
fi
fi
CLASSPATH
=
$CLASSPATH_PREFIX
:
CLASSPATH
=
$CLASSPATH_PREFIX
:
...
@@ -68,14 +52,15 @@ EXTRA_JVM_ARGUMENTS=""
...
@@ -68,14 +52,15 @@ EXTRA_JVM_ARGUMENTS=""
cd
"
$BASEDIR
/boot"
;
cd
"
$BASEDIR
/boot"
;
writelog
"starting application
$PROJECT_NAME
......"
echo
"starting application
$PROJECT_NAME
......"
exec
"
$JAVACMD
"
$JAVA_OPTS
\
exec
"
$JAVACMD
"
$JAVA_OPTS
\
$EXTRA_JVM_ARGUMENTS
\
$EXTRA_JVM_ARGUMENTS
\
-Dapp
.name
=
"
$PROJECT_NAME
"
\
-Dapp
.name
=
"
$PROJECT_NAME
"
\
-Dapp
.port
=
"
$PORT
"
\
-Dapp
.port
=
"
$PORT
"
\
-Dbasedir
=
"
$BASEDIR
"
\
-Dbasedir
=
"
$BASEDIR
"
\
-Djava
.io.tmpdir
=
$TEMP_PATH
\
-Djava
.io.tmpdir
=
$TEMP_PATH
\
-agentlib
:jdwp
=
transport
=
dt_socket,server
=
y,suspend
=
n,address
=
6913
\
-Dloader
.path
=
"file://
$BASEDIR
/conf,file://
$BASEDIR
/lib"
\
-agentlib
:jdwp
=
transport
=
dt_socket,server
=
y,suspend
=
n,address
=
41086
\
-jar
$MAIN_CLASS
\
-jar
$MAIN_CLASS
\
>
/dev/null &
>
/dev/null &
...
@@ -83,11 +68,11 @@ for i in {1..60}
...
@@ -83,11 +68,11 @@ for i in {1..60}
do
do
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
$jcpid
]
;
then
if
[
$jcpid
]
;
then
writelog
"The
$PROJECT_NAME
start finished, PID is
$jcpid
"
echo
"The
$PROJECT_NAME
start finished, PID is
$jcpid
"
exit
$SUCCESS
exit
$SUCCESS
else
else
writelog
"starting the application ..
$i
"
echo
"starting the application ..
$i
"
sleep
1
sleep
1
fi
fi
done
done
writelog
"
$PROJECT_NAME
start failure!"
echo
"
$PROJECT_NAME
start failure!"
This diff is collapsed.
Click to expand it.
appbuild-manager/src/main/bin/stop.sh
0 → 100644
View file @
4addb943
#! /bin/sh
PORT
=
"@profiles.server.port@"
BASEDIR
=
`
dirname
$0
`
BASEDIR
=
`
(
cd
"
$BASEDIR
"
;
pwd
)
`
PROJECT_NAME
=
"@project.artifactId@"
MAIN_CLASS
=
"
$PROJECT_NAME
"
;
if
[
!
-n
"
$PORT
"
]
;
then
echo
$"Usage:
$0
{port}"
exit
$FAIL
fi
echo
"stoping application
$PROJECT_NAME
......"
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
-z
$jcpid
]
;
then
echo
"
$PROJECT_NAME
is not started or has been stopped!"
else
curl
-X
POST
-i
-u
$SECURITY_USERNAME
:
$SECURITY_PASSWORD
http://127.0.0.1:
$PORT
/xxx_manager/shutdown
for
i
in
{
1..60
}
do
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
-z
$jcpid
]
;
then
echo
"
$PROJECT_NAME
has been stopped!"
break
else
echo
"stoping the application ..
$i
"
sleep
1
fi
done
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
$jcpid
]
;
then
[
-z
$jcpid
]
||
kill
-15
$jcpid
for
i
in
{
1..30
}
do
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
-z
$jcpid
]
;
then
echo
"
$PROJECT_NAME
has been stopped!"
break
else
echo
"stoping the application ..
$i
"
sleep
1
fi
done
fi
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
$jcpid
]
;
then
[
-z
$jcpid
]
||
kill
-9
$jcpid
[
$?
-eq
0
]
&&
echo
"Stop
$PROJECT_NAME
OK!"
||
echo
"Stop
$PROJECT_NAME
Fail!"
fi
fi
This diff is collapsed.
Click to expand it.
appbuild-manager/src/main/resources/logback-spring.xml
View file @
4addb943
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<!-- 定义变量后,可以使“${}”来使用变量 source来源为spring 上下文信息 -->
<springProperty
scope=
"context"
name=
"springApplicationName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"springApplicationName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"serverPort"
source=
"server.port"
/>
<springProperty
scope=
"context"
name=
"serverPort"
source=
"server.port"
/>
<springProperty
scope=
"context"
name=
"logFilePath"
source=
"application.log.path"
defaultValue=
"/mortals/app/logs"
/>
<springProperty
scope=
"context"
name=
"logFilePath"
source=
"application.log.path"
defaultValue=
"/mortals/app/logs"
/>
<springProperty
scope=
"context"
name=
"logLevel"
source=
"application.log.level"
defaultValue=
"INFO"
/>
<springProperty
scope=
"context"
name=
"logLevel"
source=
"application.log.level"
defaultValue=
"INFO"
/>
<property
name=
"logFilePath"
value=
"${logFilePath:-/mortals/app/logs}"
/>
<property
name=
"logLevel"
value=
"${logLevel:-INFO}"
/>
<!-- appender用来格式化日志输出节点,有俩个属性name和class,class用来指定哪种输出策略,常用就是控制台输出策略和文件输出策略 -->
<!-- 控制台输出策略-->
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%thread] [%.50c\(%L\)] - %msg%n
</pattern>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%X{traceId}] [%thread] [%.50c\(%L\)] - %msg%n
</pattern>
</encoder>
</encoder>
</appender>
</appender>
<!-- 文件输出策略-->
<appender
name=
"fileInfo"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<appender
name=
"fileInfo"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder>
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%thread] [%.50c\(%L\)] - %msg%n
</pattern>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%
X{traceId}] [%
thread] [%.50c\(%L\)] - %msg%n
</pattern>
</encoder>
</encoder>
<file>
${logFilePath}/${springApplicationName:-default}/${s
erverPort
:-default}-info.log
</file>
<file>
${logFilePath}/${springApplicationName:-default}/${s
pringApplicationName
:-default}-info.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logFilePath}/${springApplicationName:-default}/${serverPort:-default}-info.log.%d{yyyyMMdd}
</fileNamePattern>
<!-- 文件保存策略-->
<fileNamePattern>
${logFilePath}/${springApplicationName:-default}/${springApplicationName:-default}-info.log.%d{yyyyMMdd}
</fileNamePattern>
<cleanHistoryOnStart>
true
</cleanHistoryOnStart>
<!--日志文件保留天数-->
<MaxHistory>
15
</MaxHistory>
</rollingPolicy>
</rollingPolicy>
</appender>
</appender>
<!-- 异常文件输出策略-->
<appender
name=
"fileError"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<appender
name=
"fileError"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
ERROR
</level>
<level>
ERROR
</level>
</filter>
</filter>
<encoder>
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%thread] [%.50c\(%L\)] - %msg%n
</pattern>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%
X{traceId}] [%
thread] [%.50c\(%L\)] - %msg%n
</pattern>
</encoder>
</encoder>
<file>
${logFilePath}/${springApplicationName:-default}/${s
erverPort
:-default}-error.log
</file>
<file>
${logFilePath}/${springApplicationName:-default}/${s
pringApplicationName
:-default}-error.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logFilePath}/${springApplicationName:-default}/${serverPort:-default}-error.log.%d{yyyyMMdd}
</fileNamePattern>
<fileNamePattern>
${logFilePath}/${springApplicationName:-default}/${springApplicationName:-default}-error.log.%d{yyyyMMdd}
</fileNamePattern>
<!--日志文件保留天数-->
<cleanHistoryOnStart>
true
</cleanHistoryOnStart>
<MaxHistory>
15
</MaxHistory>
</rollingPolicy>
</rollingPolicy>
</appender>
</appender>
<logger
name=
"com.mortals.xhx.module"
level=
"DEBUG"
additivity=
"false"
/>
<root
level=
"${logLevel}"
>
<root
level=
"${logLevel}"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"fileInfo"
/>
<appender-ref
ref=
"fileInfo"
/>
<appender-ref
ref=
"fileError"
/>
<appender-ref
ref=
"fileError"
/>
</root>
</root>
<logger
name=
"com.mortals.xhx.module"
level=
"INFO"
additivity=
"false"
>
<!--TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<!--用来设置某一个包或者具体的某一个类的日志打印级别、以及指定<appender>。<logger>仅有一个name属性,一个可选的level和一个可选的additivity属性。-->
<!-- name 用来指定受此loger约束的某一个包或者具体的某一个类-->
<!-- level 用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。如果未设置此属性,那么当前logger将会继承上级的级别-->
<!-- additivity 是否向上级logger传递打印信息。默认是true。false:表示只用当前logger的appender-ref。true:表示当前logger的appender-ref和rootLogger的appender-ref都有效。-->
<logger
name=
"com.mortals"
level=
"${logLevel}"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"fileInfo"
/>
<appender-ref
ref=
"fileError"
/>
</logger>
<logger
name=
"com.mortals.xhx.module"
level=
"${logLevel}"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"fileInfo"
/>
<appender-ref
ref=
"fileInfo"
/>
<appender-ref
ref=
"fileError"
/>
<appender-ref
ref=
"fileError"
/>
</logger>
</logger>
</configuration>
</configuration>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
assembly/assembly-manager-ui.xml
0 → 100644
View file @
4addb943
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"
>
<id>
release
</id>
<formats>
<format>
tar.gz
</format>
</formats>
<!-- 需要打包的文件集 -->
<fileSets>
<fileSet>
<directory>
${project.parent.basedir}/appbuild-manage-ui/admin/dist
</directory>
<includes>
<include>
**/*
</include>
</includes>
<outputDirectory>
/dist
</outputDirectory>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
assembly/assembly.xml
0 → 100644
View file @
4addb943
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"
>
<id>
release
</id>
<formats>
<format>
tar.gz
</format>
</formats>
<fileSets>
<fileSet>
<directory>
target/bin
</directory>
<outputDirectory>
bin
</outputDirectory>
<fileMode>
0755
</fileMode>
</fileSet>
<fileSet>
<directory>
${project.parent.basedir}/dist/${project.parent.artifactId}/boot
</directory>
<outputDirectory>
boot
</outputDirectory>
<fileMode>
0755
</fileMode>
</fileSet>
<fileSet>
<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
This diff is collapsed.
Click to expand it.
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