autobuild.sh 563 B

1234567891011121314151617181920212223242526272829303132333435
  1. BASE_DIR="$(pwd)"
  2. cd $BASE_DIR
  3. git status
  4. git pull
  5. if [ $? -ne 0 ]; then
  6. echo "[ERROR git failed in $BASE_DIR]"
  7. exit 3
  8. fi
  9. if [ ! -d $BASE_DIR/vue ]
  10. then
  11. echo "[ERROR] Please run the script in h5app dir."
  12. exit 2;
  13. fi
  14. cd $BASE_DIR/vue
  15. echo "[Running] npm run build"
  16. npm run build
  17. if [ $? -ne 0 ] ; then
  18. echo "[ERROR] npm run build failed with $?"
  19. exit 2;
  20. fi
  21. rm -rf $BASR_DIR/deploy
  22. mv $BASE_DIR/vue/dist $BASE_DIR/
  23. mv $BASE_DIR/dist $BASE_DIR/deploy
  24. cd $BASE_DIR
  25. git add deploy
  26. git commit -m "$(date) autobuild on fe"
  27. git push