|
@@ -70,30 +70,44 @@ yarn serve
|
|
测试环境项目地址:https://scene.4dage.com/?m=1172
|
|
测试环境项目地址:https://scene.4dage.com/?m=1172
|
|
|
|
|
|
```bash
|
|
```bash
|
|
-mv .temp/* .
|
|
|
|
-
|
|
|
|
scene=${SPUG_GIT_BRANCH%%/*}
|
|
scene=${SPUG_GIT_BRANCH%%/*}
|
|
-lastFileDir=$(ls -d -F /home/spug_backup/vue3-scene-web/* -t | grep '/$' | head -n 2 | tail -n 1)
|
|
|
|
|
|
|
|
echo "当前场景值:$scene"
|
|
echo "当前场景值:$scene"
|
|
-echo "上一个部署目录:$lastFileDir"
|
|
|
|
|
|
|
|
-if [ -d "${lastFileDir}data/" ]
|
|
|
|
|
|
+if [ $SPUG_DEPLOY_TYPE == "2" ]
|
|
then
|
|
then
|
|
- echo "copy data file"
|
|
|
|
- cp -r -n ${lastFileDir}data/ .
|
|
|
|
-fi
|
|
|
|
|
|
+ echo "开始回滚"
|
|
|
|
+ basename "$PWD"
|
|
|
|
+else
|
|
|
|
+ mv .temp/* .
|
|
|
|
|
|
-if [ -d "${lastFileDir}resources/web/" ]
|
|
|
|
-then
|
|
|
|
- echo "copy resources file"
|
|
|
|
- if [ $scene = "test" ]
|
|
|
|
|
|
+ fileCount=$(find /home/spug_backup/vue3-scene-web/* -maxdepth 0 -type d -printf '.' | wc -c)
|
|
|
|
+ echo "当前文件夹数量:$fileCount"
|
|
|
|
+
|
|
|
|
+ if [ ${fileCount} -gt 1 ]
|
|
then
|
|
then
|
|
- rsync -au --exclude=js --exclude=img --exclude=fonts --exclude=css ${lastFileDir}resources/web ./resources
|
|
|
|
- else
|
|
|
|
- rsync -au --exclude=$scene ${lastFileDir}resources/web ./resources
|
|
|
|
|
|
+ lastFileDir=$(ls -d -F /home/spug_backup/vue3-scene-web/* -t | grep '/$' | head -n 2 | tail -n 1)
|
|
|
|
+
|
|
|
|
+ echo "上一个部署目录:$lastFileDir"
|
|
|
|
+
|
|
|
|
+ if [ -d "${lastFileDir}data/" ]
|
|
|
|
+ then
|
|
|
|
+ echo "copy data file"
|
|
|
|
+ cp -rTn ${lastFileDir}data/ ./data
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
+ if [ -d "${lastFileDir}resources/web/" ]
|
|
|
|
+ then
|
|
|
|
+ echo "copy resources file"
|
|
|
|
+ if [ $scene = "test" ]
|
|
|
|
+ then
|
|
|
|
+ rsync -rtvu --exclude=./js --exclude=./img --exclude=./fonts --exclude=./css ${lastFileDir}resources/web/ ./resources/web/
|
|
|
|
+ else
|
|
|
|
+ rsync -rtvu --exclude=$scene ${lastFileDir}resources/web/ ./resources/web/
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
fi
|
|
fi
|
|
-fi
|
|
|
|
|
|
|
|
-rm -r .temp
|
|
|
|
|
|
+ rm -r .temp
|
|
|
|
+fi
|
|
```
|
|
```
|