Bladeren bron

Merge branch 'dev_v4.1.0' of http://git.qmth.com.cn/examcloud-backend/examcloud-core-examwork into dev_v4.1.0

qinchao 4 jaren geleden
bovenliggende
commit
6cdd90758f

+ 1 - 1
examcloud-core-examwork-starter/shell/start.args

@@ -1 +1 @@
---spring.profiles.active=dev --examcloud.startup.configCenterHost=192.168.10.39
+--spring.profiles.active=dev --sys.config.center.address=192.168.10.39:8888

+ 7 - 28
examcloud-core-examwork-starter/shell/start.sh

@@ -1,38 +1,17 @@
 #!/bin/bash
 
-FILE_PATH=$(cd `dirname $0`; pwd)
+PROJECT_JAR="examcloud-core-examwork-starter-v4.1.0-SNAPSHOT.jar"
 
-APP_MAIN_JAR="examcloud-core-examwork-starter-v4.1.0-SNAPSHOT.jar"
+PROJECT_JVM_ARGS=`cat start.vmoptions`
 
-JAVA_OPTS=`cat $FILE_PATH/start.vmoptions`
-APP_ARGS=`cat $FILE_PATH/start.args`
-
-PID_LIST=`ps -ef|grep $APP_MAIN_JAR|grep java|awk '{print $2}'`
+PROJECT_ARGS=`cat start.args`
 
+PID_LIST=`ps -ef | grep $PROJECT_JAR | grep java | awk '{print $2}'`
 if [ ! -z "$PID_LIST" ]; then
-    echo "[ERROR] : APP is already running!"
+    echo "$PROJECT_JAR is already running..."
     exit -1
 fi
 
-if [ "$1" ];then
-    echo "startupCode:"$1;
-else
-    echo "[ERROR] : no arguments"
-    exit -1
-fi
-
-APP_ARGS=$APP_ARGS" --examcloud.startup.startupCode="$1
-
-echo "java options:"
-echo "$JAVA_OPTS"
-echo "args:"
-echo "$APP_ARGS"
-    
-nohup java $JAVA_OPTS -jar $FILE_PATH/lib/$APP_MAIN_JAR $APP_ARGS >/dev/null 2>&1 &
-
-echo "starting......"
-
-exit 0
-
-
+nohup java $PROJECT_JVM_ARGS -jar lib/$PROJECT_JAR $PROJECT_ARGS >/dev/null 2>&1 &
 
+echo "$PROJECT_JAR start..."

+ 4 - 14
examcloud-core-examwork-starter/shell/stop.sh

@@ -1,18 +1,8 @@
 #!/bin/bash
 
-FILE_PATH=$(cd `dirname $0`; pwd)
+PROJECT_JAR="examcloud-core-examwork-starter-v4.1.0-SNAPSHOT.jar"
 
-APP_MAIN_JAR="examcloud-core-examwork-starter-v4.1.0-SNAPSHOT.jar"
+ps -ef | grep $PROJECT_JAR | grep java | awk '{printf("kill -15 %s\n",$2)}' | sh
+BUILD_ID=DONTKILLME
 
-PID_LIST=`ps -ef|grep $APP_MAIN_JAR|grep java|awk '{print $2}'`
-
-if [ ! -z "$PID_LIST" ]; then
-    echo "Runnable jar is $APP_MAIN_JAR."
-    for PID in $PID_LIST 
-    do
-        kill -9 $PID
-    done
-    echo "stopped !"
-fi
-
-exit 0
+echo "$PROJECT_JAR stop..."

+ 3 - 16
examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/CoreExamWorkApp.java

@@ -2,9 +2,8 @@ package cn.com.qmth.examcloud.core.examwork.starter;
 
 import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
 import cn.com.qmth.examcloud.core.examwork.dao.UniqueRuleHolder;
-import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
 import cn.com.qmth.examcloud.web.jpa.DataIntegrityViolationTransverter;
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
+import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.domain.EntityScan;
 import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
@@ -49,20 +48,8 @@ public class CoreExamWorkApp {
      * @author WANGWEI
      */
     public static void main(String[] args) throws Exception {
-        //test 再次测试git文件,配合测试20200928004
-        AppBootstrap.run(CoreExamWorkApp.class, args);
-
-        test();
-    }
-
-    /**
-     * 测试方法
-     *
-     * @author WANGWEI
-     */
-    private static void test() {
-        Tester tester = SpringContextHolder.getBean(Tester.class);
-        tester.test();
+        // AppBootstrap.run(CoreExamWorkApp.class, args);
+        SpringApplication.run(CoreExamWorkApp.class, args);
     }
 
     @Bean(name = "multipartResolver")

+ 5 - 7
examcloud-core-examwork-starter/src/main/resources/application.properties

@@ -1,8 +1,6 @@
 spring.profiles.active=dev
-
-examcloud.startup.startupCode=8001
-examcloud.startup.configCenterHost=192.168.10.39
-examcloud.startup.configCenterPort=9999
-examcloud.startup.appCode=E
-
-
+sys.config.center.enabled=true
+sys.config.center.address=192.168.10.39:8888
+sys.config.center.namespace=examcloud
+sys.config.center.appCode=E
+sys.config.center.secretKey=

+ 4 - 0
jenkins-prod.sh → jenkins.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
+
 pwd
+mkdir -p ~/packages
 
 cp examcloud-core-examwork-starter/target/examcloud-core-examwork-distribution.zip ~/packages
+
+echo "finished..."