Skip to content

Commit b53de78

Browse files
🐯 优化deploy.sh
1 parent c8aafc3 commit b53de78

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

deploy/deploy.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ else
4343

4444
if [[ ! $PULL_RESULT == *up-to-date* ]]
4545
then
46-
echo "Update code..."
46+
echo "update code..."
4747
IS_UPDATE=1
4848
fi
4949
fi
@@ -54,8 +54,16 @@ pwd
5454
mvn clean
5555
mvn package -Ptest
5656

57+
pwd
58+
# 判断是否生成成功
59+
if [ ! -f "target/spring-boot-plus-server-assembly.tar.gz" ]; then
60+
echo "maven build fail"
61+
exit
62+
fi
63+
5764
# 3. 停服
5865
cd ..
66+
pwd
5967

6068
if [ -d "spring-boot-plus-server" ]; then
6169
sh spring-boot-plus-server/bin/shutdown.sh
@@ -72,18 +80,18 @@ if [[ $IS_UPDATE == 1 ]]
7280
then
7381
echo "Back spring-boot-plus-server..."
7482
mv spring-boot-plus-server spring-boot-plus-server-back/spring-boot-plus-server-back-"${NOW}"
83+
echo "back success"
7584
fi
7685

7786
echo "Copy spring-boot-plus-server-assembly.tar.gz..."
7887
# 复制到项目同级目录,如果有,则覆盖
7988
cp -r -f spring-boot-plus/target/spring-boot-plus-server-assembly.tar.gz spring-boot-plus-server-assembly.tar.gz
89+
echo "copy success"
8090

91+
pwd
8192
# 5. 运行spring-boot-plus
8293
tar -zxvf spring-boot-plus-server-assembly.tar.gz
83-
cd spring-boot-plus-server/bin
84-
sh restart.sh
94+
echo "tar.gz decompression success"
8595

86-
# 6. 访问项目
87-
# 输出项目日志
88-
# http://localhost:8888/docs
96+
sh spring-boot-plus-server/bin/restart.sh
8997

0 commit comments

Comments
 (0)