Sfoglia il codice sorgente

41环境的jenkins脚本

刘洋 1 anno fa
parent
commit
e6c2005ce3
1 ha cambiato i file con 11 aggiunte e 12 eliminazioni
  1. 11 12
      jenkins.sh

+ 11 - 12
jenkins.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 set -e # 如果构建失败,则退出,不能删除旧的包
-
-if [ "$#" -ne 1 ]; then
+if [ "$#" -ne 1 ] ; then
   echo "Usage: $0 BUILD_ENV" >&2
   exit 1
 fi
@@ -10,21 +9,21 @@ pwd
 
 echo “build env: $1”
 
-npm -v
-npm install --registry=https://registry.npmmirror.com
-npm run build:$1
+pwd
+
+npm install
+npm run build
 
-mkdir -p ~/home/admin/project/exam-reserve/static/wap/temp
-cp -r dist ~/home/admin/project/exam-reserve/static/wap/temp
+mkdir -p ~/project/exam-reserve/static/wap/temp
+cp -r  dist ~/project/exam-reserve/static/wap/temp
 
-cd ~/home/admin/project/exam-reserve/static/wap
+cd ~/project/exam-reserve/static/wap
 if [ -d "dist" ]; then
-  currentTime=$(date "+%Y%m%d%H%M%S")
-  echo "dist backup... $currentTime"
-  tar cf guangkai-wap-bak-$currentTime.tar.gz dist
   rm -rf dist/*
 fi
 
-mv temp/dist .
+mkdir -p dist
+
+mv temp/dist/* dist/
 rm -rf temp
 echo "ok..."