Browse Source

update shells

deason 2 months ago
parent
commit
08136ca5cd
3 changed files with 46 additions and 0 deletions
  1. 21 0
      shell/examcloud-ws.service
  2. 18 0
      shell/re-deploy.sh
  3. 7 0
      shell/re-start.sh

+ 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=80.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..."