配合Jenkins自动化构建,bat脚本(一)

1 C:\Windows\System32\inetsrv\appcmd.exe stop site ServiceIIS
2 C:\Windows\System32\inetsrv\appcmd.exe stop apppool ServiceIIS
3 C:\Windows\System32\inetsrv\appcmd.exe start apppool ServiceIIS
4 C:\Windows\System32\inetsrv\appcmd.exe start site ServiceIIS

以上 iis站点的重启

 

 1 rem 当前文件夹目录
 2 set curdir=%~dp0
 3 
 4 rem WCF服务地址
 5 set WCFServer=http://localhost:8807/AuditService.svc?wsdl
 6 
 7 rem Silverlight 服务模型代理生成工具路径
 8 set slsvcutil="C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Tools\SlSvcUtil.exe"
 9 
10 rem 删除 AuditService 
11 rd /s /q "%curdir%Ehong.MedicareReview\Service References\AuditService"
12 
13 rem 创建
14 md "%curdir%Ehong.MedicareReview\Service References\AuditService"
15 
16 rem 命名空间
17 set NS="*,Ehong.MedicareReview.AuditService"
18 
19 rem 创建 UserService 代理类
20 cd "%curdir%Ehong.MedicareReview\Service References\AuditService"
21 %slsvcutil% %WCFServer% /edb /o:Reference.cs /namespace:%NS% /ct:System.Collections.ObjectModel.ObservableCollection`1 /r:"%curdir%Ehong.MedicareReview.Domain\Bin\Release\Ehong.MedicareReview.Domain.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v5.0\System.Windows.dll"
22 
23 
24 
25 
26 rem cmd /k echo.

 以上wcf引用更新

 

rem 当前的路径
set curdir=%~dp0

rem 需要替换到程序编译的config路径,此config是客户端命令行引用WCF服务专用config
set customConfig="%curdir%Ehong.MedicareReview.Service\App_Data\Custom\Web.config"

rem 正常的config
set safeConfig="%curdir%Ehong.MedicareReview.Service\App_Data\Safe\Web.config"

set currConfig="%curdir%Ehong.MedicareReview.Service\Web.config"

del /q %currConfig%

xcopy %safeConfig% "%curdir%Ehong.MedicareReview.Service"

rem  cmd /k echo.

 以上配置文件的替换

 

 1     set curdir=%~dp0
 2 
 3     set strFile="C:\IIS\MainEdition\MedicareReview\ClientBin\Ehong.MedicareReview.xap"
 4     
 5     set strFilePublicity="C:\IIS\MainEdition\Publicity\ClientBin\Ehong.Publicity.xap"    
 6     
 7   set strSignCode="C:\Program Files (x86)\Windows Kits\8.0\bin\x86\signtool.exe"
 8 
 9   set strPfx="%curdir%Ehong.MedicareReview\ehong-new.pfx"
10         set strPfxPublicity="%curdir%项目名称\签名文件.pfx"
11 
12   set strPwd=签名文件的密码
13 
14   set strTimeStampUrl=http://timestamp.wosign.com/timestamp
15 
16   echo Execute signtool.exe
17 
18   rem %strSignCode% sign /f %strPfx% /p %strPwd% /t %strTimeStampUrl% %strFile%
19 
20   %strSignCode% sign /f %strPfx% /p %strPwd% %strFile%
21         %strSignCode% sign /f %strPfxPublicity% /p %strPwd% %strFilePublicity%
22   if errorlevel 1 goto enderror
23 
24   if errorlevel 0 goto endSuccess
25 
26 :enderror
27 echo "发生错误"
28 
29 
30 :endSuccess    
31 echo "签名成功"

 以上程序签名

 

你可能感兴趣的:(配合Jenkins自动化构建,bat脚本(一))