فهرست منبع

update shells

deason 2 ماه پیش
والد
کامیت
2ba849a664
6فایلهای تغییر یافته به همراه86 افزوده شده و 30 حذف شده
  1. 38 27
      assembly.xml
  2. 21 0
      shell/examcloud-ws.service
  3. 18 0
      shell/re-deploy.sh
  4. 7 0
      shell/re-start.sh
  5. 1 2
      shell/start.sh
  6. 1 1
      shell/stop.sh

+ 38 - 27
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
shell/examcloud-ws.service

@@ -0,0 +1,21 @@
+[Unit]
+Description=examcloud-ws
+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-ws
+ExecStart=/usr/local/JDK/jdk1.8.0_333/bin/java \
+-server -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=75.0 \
+-XX:-UseGCOverheadLimit -Dlog.commonLevel=WARN \
+-jar lib/examcloud-ws.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
shell/re-deploy.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+
+PROJECT_NAME="examcloud-ws"
+
+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
shell/re-start.sh

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

+ 1 - 2
shell/start.sh

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

+ 1 - 1
shell/stop.sh

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