WANG 5 anos atrás
pai
commit
6b0265ce14

+ 31 - 0
examcloud-core-oe-admin-starter/assembly.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+    <id>distribution</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/src/main/resources</directory>
+            <outputDirectory>/config</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/shell</directory>
+            <excludes>
+                <exclude>start.args</exclude>
+                <exclude>start.vmoptions</exclude>
+            </excludes>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0777</fileMode>
+        </fileSet>
+    </fileSets>
+    <dependencySets>
+        <dependencySet>
+            <useProjectArtifact>true</useProjectArtifact>
+            <outputDirectory>lib</outputDirectory>
+            <scope>runtime</scope>
+        </dependencySet>
+    </dependencySets>
+</assembly>

+ 1 - 0
examcloud-core-oe-admin-starter/shell/start.args

@@ -0,0 +1 @@
+--spring.profiles.active=test

+ 35 - 0
examcloud-core-oe-admin-starter/shell/start.sh

@@ -0,0 +1,35 @@
+#!/bin/bash
+
+APP_MAIN_JAR="examcloud-core-oe-admin-starter-2019-SNAPSHOT.jar"
+
+FILE_PATH=$(cd `dirname $0`; pwd)
+
+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}'`
+
+if [ ! -z "$PID_LIST" ]; then
+    echo "[ERROR] : APP 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

+ 1 - 0
examcloud-core-oe-admin-starter/shell/start.vmoptions

@@ -0,0 +1 @@
+-server -Xms512m -Xmx512m

+ 13 - 0
examcloud-core-oe-admin-starter/shell/stop.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+APP_MAIN_JAR="examcloud-core-oe-admin-starter-2019-SNAPSHOT.jar"
+FILE_PATH=$(cd `dirname $0`; pwd)
+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