From 5c96d75d39cf78a5d4868984a90bb456cd77f825 Mon Sep 17 00:00:00 2001 From: lexluo09 <39718951+lexluo09@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:13:57 +0800 Subject: [PATCH] [improvement](project) If there are any failed operations during the build process, stop subsequent operations and issue a unified 'stop' command. (#498) --- assembly/bin/supersonic-build.sh | 12 ++++++++++-- assembly/bin/supersonic-daemon.sh | 13 ++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/assembly/bin/supersonic-build.sh b/assembly/bin/supersonic-build.sh index 594a79765..05a0af8ee 100755 --- a/assembly/bin/supersonic-build.sh +++ b/assembly/bin/supersonic-build.sh @@ -10,10 +10,13 @@ cd $baseDir #1. build backend java modules rm -fr ${buildDir}/*.tar.gz rm -fr dist - set +x - mvn -f $baseDir/../ clean package -DskipTests +# check build result +if [ $? -ne 0 ]; then + echo "Failed to build backend Java modules." + exit 1 +fi #2. move package to build cp $baseDir/../launchers/semantic/target/*.tar.gz ${buildDir}/supersonic-semantic.tar.gz @@ -26,6 +29,11 @@ cd ../webapp sh ./start-fe-prod.sh cp -fr ./supersonic-webapp.tar.gz ${buildDir}/ +# check build result +if [ $? -ne 0 ]; then + echo "Failed to build frontend webapp." + exit 1 +fi #4. copy webapp to java classpath cd $buildDir tar xvf supersonic-webapp.tar.gz diff --git a/assembly/bin/supersonic-daemon.sh b/assembly/bin/supersonic-daemon.sh index 68a8c63ab..7dff8e3ab 100755 --- a/assembly/bin/supersonic-daemon.sh +++ b/assembly/bin/supersonic-daemon.sh @@ -108,15 +108,10 @@ case "$command" in echo "Start success" ;; stop) - if [ "$service" == $PYLLM_SERVICE ]; then - echo "Stopping $app_name" - stop $app_name - echo "Stopping $STANDALONE_APP_NAME" - stop $STANDALONE_APP_NAME - else - echo "Stopping $app_name" - stop ${app_name} - fi + echo "Stopping $app_name" + stop $app_name + echo "Stopping $PYLLM_APP_NAME" + stop $PYLLM_APP_NAME echo "Stop success" ;; reload)