deason преди 2 месеца
родител
ревизия
a5f95c754d

+ 38 - 27
examcloud-exchange-starter/assembly.xml

@@ -1,33 +1,44 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		  xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
 
-	<id>distribution</id>
-	<formats>
-		<format>zip</format>
-	</formats>
+    <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>
+    <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>
+    <dependencySets>
+        <dependencySet>
+            <useProjectArtifact>true</useProjectArtifact>
+            <outputDirectory>lib</outputDirectory>
+            <scope>runtime</scope>
+            <includes>
+                <include>${project.groupId}:${project.artifactId}</include>
+            </includes>
+            <outputFileNameMapping>
+                ${artifact.artifactId}.${artifact.extension}
+            </outputFileNameMapping>
+        </dependencySet>
+        <dependencySet>
+            <useProjectArtifact>false</useProjectArtifact>
+            <outputDirectory>lib</outputDirectory>
+            <scope>runtime</scope>
+        </dependencySet>
+    </dependencySets>
 </assembly>

+ 21 - 0
examcloud-exchange-starter/shell/examcloud-exchange.service

@@ -0,0 +1,21 @@
+[Unit]
+Description=examcloud-exchange
+After=local-fs.target network-online.target network.target
+Wants=local-fs.target network-online.target network.target
+[Service]
+User=admin
+Group=admin
+StandardOutput=null
+StandardError=null
+WorkingDirectory=/home/admin/project/examcloud/examcloud-exchange
+ExecStart=/usr/local/JDK/jdk1.8.0_333/bin/java \
+-server -Xms1g -Xmx2g \
+-XX:-UseGCOverheadLimit -Dlog.commonLevel=WARN \
+-jar lib/examcloud-exchange-starter.jar \
+--spring.profiles.active=prod \
+--sys.config.center.address=192.168.1.60:8888 \
+--sys.config.center.secretKey=0b0dfea77bd5f606918e84ebdb443c9e
+Restart=always
+LimitNOFILE=20480000
+[Install]
+WantedBy=multi-user.target

+ 18 - 0
examcloud-exchange-starter/shell/re-deploy.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+
+PROJECT_NAME="examcloud-exchange"
+
+cd ..
+if [ -e "$PROJECT_NAME-distribution.zip" ]; then
+  currentTime=`date "+%Y%m%d%H%M%S"`
+  mkdir -p backup
+  mv $PROJECT_NAME-distribution.zip backup/$PROJECT_NAME-distribution-$currentTime.zip
+  echo "backup ok..."
+fi
+
+wget https://pub-qmth.oss-cn-shenzhen-internal.aliyuncs.com/pub/exam_cloud_packages/$PROJECT_NAME-distribution.zip
+#wget https://pub-qmth.oss-cn-shenzhen.aliyuncs.com/pub/exam_cloud_packages/$PROJECT_NAME-distribution.zip
+rm -rf $PROJECT_NAME/lib/ $PROJECT_NAME/config/
+unzip -q -o $PROJECT_NAME-distribution.zip
+
+echo "finished..."

+ 7 - 0
examcloud-exchange-starter/shell/re-start.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+#sudo cp examcloud-exchange.service /etc/systemd/system/examcloud-exchange.service
+sudo systemctl stop examcloud-exchange.service
+sudo systemctl start examcloud-exchange.service
+
+echo "ok..."

+ 1 - 2
examcloud-exchange-starter/shell/start.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 
-PROJECT_JAR=`find . -name "examcloud-exchange-starter*.jar"`
-PROJECT_JAR=${PROJECT_JAR:6}
+PROJECT_JAR="examcloud-exchange-starter.jar"
 
 PROJECT_ARGS=`cat start.args`
 PROJECT_ARGS=$PROJECT_ARGS" --sys.config.center.secretKey="$1

+ 1 - 1
examcloud-exchange-starter/shell/stop.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-PROJECT_JAR="examcloud-exchange-starter"
+PROJECT_JAR="examcloud-exchange-starter.jar"
 
 ps -ef | grep $PROJECT_JAR | grep java | awk '{printf("kill -15 %s\n",$2)}' | sh
 BUILD_ID=DONTKILLME