Browse Source

新的构建

Michael Wang 4 years ago
parent
commit
26f3bbb9c3
7 changed files with 40 additions and 31 deletions
  1. 0 10
      .env.30
  2. 3 3
      .env.production
  3. 0 12
      .env.stagingAli
  4. 3 3
      .env.test
  5. 31 0
      jenkins.sh
  6. 1 1
      package.json
  7. 2 2
      public/index.html

+ 0 - 10
.env.30

@@ -1,10 +0,0 @@
-NODE_ENV=production
-VUE_APP_ECS_CORE=https://ecs-dev.qmth.com.cn:8878
-VUE_APP_ENV=192.168.10.30(测试服务器)
-VUE_APP_FACEPP_API_KEY=kEz_MSSjkNuHL3fHhCvv62fXkAo-vobE 
-VUE_APP_FACEPP_API_SECRET=aQMioMGUDShMnQmfM1_H_kPTP2pJva6J
-VUE_APP_UPYUN_OPERATOR=examcloud
-VUE_APP_UPYUN_PASSWORD=ecs87863577!@#
-VUE_APP_UPYUN_SERVER=v0.api.upyun.com
-VUE_APP_UPYUN_BUCKET=exam-cloud-test
-VUE_APP_UPYUN_BUCKETURL=/exam-cloud-test/student_base_photo/

+ 3 - 3
.env.production

@@ -1,7 +1,7 @@
 NODE_ENV=production
-VUE_APP_ELECTRON_CLIENT_VERSION=3.0.0
-VUE_APP_ECS_CORE=https://exam-cloud.cn
-VUE_APP_ENV=exam-cloud.cn(线上服务器)
+VUE_APP_ELECTRON_CLIENT_VERSION=3.0.1
+VUE_APP_ECS_CORE=https://www.exam-cloud.cn
+VUE_APP_ENV=www.exam-cloud.cn(线上服务器)
 VUE_APP_FACEPP_API_URL=https://api-cn.faceplusplus.com
 VUE_APP_FACEPP_API_KEY=VOlRKNlCSAYIOcSLDKOaZukkqpmi-Pwo
 VUE_APP_FACEPP_API_SECRET=bzMjy-JfwtVUxVDMzagFh7ggbQBC71f1

+ 0 - 12
.env.stagingAli

@@ -1,12 +0,0 @@
-NODE_ENV=production
-VUE_APP_ELECTRON_CLIENT_VERSION=3.0.0
-VUE_APP_ECS_CORE=https://ecs-test.qmth.com.cn:8878
-VUE_APP_ENV=ecs-test.qmth.com.cn(测试服务器)
-VUE_APP_FACEPP_API_URL=https://api-cn.faceplusplus.com
-VUE_APP_FACEPP_API_KEY=VOlRKNlCSAYIOcSLDKOaZukkqpmi-Pwo
-VUE_APP_FACEPP_API_SECRET=bzMjy-JfwtVUxVDMzagFh7ggbQBC71f1
-VUE_APP_UPYUN_OPERATOR=examcloud
-VUE_APP_UPYUN_PASSWORD=ecs87863577!@#
-VUE_APP_UPYUN_SERVER=https://v0.api.upyun.com
-VUE_APP_UPYUN_BUCKET=exam-cloud-test
-VUE_APP_UPYUN_BUCKETURL=http://v0.api.upyun.com/exam-cloud-test/student_base_photo/

+ 3 - 3
.env.39 → .env.test

@@ -1,7 +1,7 @@
 NODE_ENV=production
-VUE_APP_ELECTRON_CLIENT_VERSION=3.0.0
-VUE_APP_ECS_CORE=https://ecs-dev.qmth.com.cn:8878
-VUE_APP_ENV=192.168.10.39(测试服务器)
+VUE_APP_ELECTRON_CLIENT_VERSION=3.0.1
+VUE_APP_ECS_CORE=https://www.ea100.com.cn
+VUE_APP_ENV=www.ea100.com.cn(测试服务器)
 VUE_APP_FACEPP_API_URL=https://api-cn.faceplusplus.com
 VUE_APP_FACEPP_API_KEY=VOlRKNlCSAYIOcSLDKOaZukkqpmi-Pwo
 VUE_APP_FACEPP_API_SECRET=bzMjy-JfwtVUxVDMzagFh7ggbQBC71f1

+ 31 - 0
jenkins.sh

@@ -0,0 +1,31 @@
+#!/bin/bash
+set -e # 如果构建失败,则退出,不能删除旧的包
+
+if [ "$#" -ne 1 ] ; then
+  echo "Usage: $0 BUILD_ENV" >&2
+  exit 1
+fi
+
+pwd
+
+echo “build env: $1”
+
+yarn
+npm run build:$1
+
+mkdir -p ~/project/examcloud/static-new/photo-upload/temp
+cp -r  dist ~/project/examcloud/static-new/photo-upload/temp
+
+cd ~/project/examcloud/static-new/photo-upload
+if [ -d "dist" ]; then
+  currentTime=`date "+%Y%m%d%H%M%S"`
+  echo "dist backup... $currentTime"
+  tar cf photo-upload-bak-$currentTime.tar.gz dist
+  rm -rf dist/*
+fi
+
+mv temp/dist .
+rm -rf temp
+echo "ok..."
+
+

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     "build:prod": "vue-cli-service build --mode production",
     "build:dev-30": "vue-cli-service build --mode 30",
     "build:dev-39": "vue-cli-service build --mode 39",
-    "build:test": "vue-cli-service build --mode stagingAli",
+    "build:test": "vue-cli-service build --mode test",
     "lint": "vue-cli-service lint"
   },
   "dependencies": {

+ 2 - 2
public/index.html

@@ -9,7 +9,7 @@
     <script type="text/javascript">
       if (typeof require === "undefined") {
         document.writeln(
-          `不能通过浏览器访问本页面。请下载最新 <a href='https://ecs.qmth.com.cn:8878/electron-config/照片上传工具-<%= VUE_APP_ELECTRON_CLIENT_VERSION %>-正式版.exe'>照片上传工具</a>`
+          `不能通过浏览器访问本页面。请下载最新 <a href='https://www.exam-cloud.cn/electron-config/照片上传工具-<%= VUE_APP_ELECTRON_CLIENT_VERSION %>-正式版.exe'>照片上传工具</a>`
         );
       }
       if (
@@ -18,7 +18,7 @@
       ) {
         setTimeout(
           () =>
-            (document.body.innerHTML = `照片上传工具版本过时。请下载最新 <a href='https://ecs.qmth.com.cn:8878/electron-config/照片上传工具-<%= VUE_APP_ELECTRON_CLIENT_VERSION %>-正式版.exe'>照片上传工具</a>`),
+            (document.body.innerHTML = `照片上传工具版本过时。请下载最新 <a href='https://www.exam-cloud.cn/electron-config/照片上传工具-<%= VUE_APP_ELECTRON_CLIENT_VERSION %>-正式版.exe'>照片上传工具</a>`),
           300
         );
       }