Bläddra i källkod

Merge branch 'master' of https://matrix.niimei.com/szustar/szugift-fe

StephenArk30 6 år sedan
förälder
incheckning
0de7b15a70
1 ändrade filer med 35 tillägg och 0 borttagningar
  1. 35 0
      sourcecode/h5app/autobuild.sh

+ 35 - 0
sourcecode/h5app/autobuild.sh

@@ -0,0 +1,35 @@
+BASE_DIR="$(pwd)"
+
+cd $BASE_DIR
+git status
+git pull
+
+if [ $? -ne 0 ]; then
+    echo "[ERROR git failed in $BASE_DIR]"
+    exit 3
+fi
+
+
+if [ ! -d $BASE_DIR/vue ]
+then
+    echo "[ERROR] Please run the script in h5app dir."
+    exit 2;
+fi
+   
+cd $BASE_DIR/vue
+    echo "[Running] npm run build"
+npm run build
+if [ $? -ne 0 ] ; then
+    echo "[ERROR] npm run build failed with $?"
+    exit 2;
+fi
+
+rm -rf $BASR_DIR/deploy
+mv $BASE_DIR/vue/dist $BASE_DIR/
+mv $BASE_DIR/dist $BASE_DIR/deploy
+cd $BASE_DIR
+
+git add deploy
+git commit -m "$(date) autobuild on fe"
+git push
+