deason 2 hónapja
szülő
commit
28007753c3
6 módosított fájl, 59 hozzáadás és 3 törlés
  1. 11 0
      assembly.xml
  2. 21 0
      shell/examcloud-app-api.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

+ 11 - 0
assembly.xml

@@ -28,6 +28,17 @@
             <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-app-api.service

@@ -0,0 +1,21 @@
+[Unit]
+Description=examcloud-app-api
+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-app-api
+ExecStart=/usr/local/JDK/jdk1.8.0_333/bin/java \
+-server -Xms1g -Xmx1g \
+-XX:-UseGCOverheadLimit -Dlog.commonLevel=WARN \
+-jar lib/examcloud-app-api.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-app-api"
+
+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-app-api.service /etc/systemd/system/examcloud-app-api.service
+sudo systemctl stop examcloud-app-api.service
+sudo systemctl start examcloud-app-api.service
+
+echo "ok..."

+ 1 - 2
shell/start.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 
-PROJECT_JAR=`find . -name "examcloud-app-api*.jar"`
-PROJECT_JAR=${PROJECT_JAR:6}
+PROJECT_JAR="examcloud-app-api.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-app-api"
+PROJECT_JAR="examcloud-app-api.jar"
 
 ps -ef | grep $PROJECT_JAR | grep java | awk '{printf("kill -15 %s\n",$2)}' | sh
 BUILD_ID=DONTKILLME