配合Jenkins自动化构建,bat脚本(二)
批量通过模板,拷贝文件,然后替换模板文件中的标记位为预制的内容。 1 Set servicePath=Ehong.MedicareReview.Web\地区配置\2 Set webPath=Ehong.MedicareReview.Web\
3 Set current=%~dp0
4
5 rem1.创建审核的配置文件
6 Set targetPath=%current%%servicePath%%targetArea%
7 rd /s /q "%targetPath%"
8 mkdir "%targetPath%"
9
10 echo f | xcopy /y "replace.bat" "%current%%webPath%\replace.bat"
11
12 rem2.进入目录
13 cd "%webPath%"
14
15 rem3.拷贝文件并重命名
16 echo f | xcopy /y "settings_debug_%fadebackmodel%.xml" "temp0.xml"
17 start replace.bat
18
19 :11
20 if not exist succeed.txt goto :11
21
22 echo f | xcopy "temp1.xml" "%targetPath%/settings.xml"
23 echo f | xcopy "temp1.xml" "%targetPath%/settings_debug.xml"
24 rem 4.svn附加文件
25 svn add "%targetPath%"--username wangzhen --password wz123
26
27 if exist temp0.xml del temp0.xml 2>nul
28 if exist temp1.xml del temp1.xml 2>nul
29 if exist succeed.txt del succeed.txt 2>nul
30 if exist replace.bat del replace.bat 2>nul
31
32 exit
页:
[1]