《Windows下自动化部署的救赎.pdf》由会员分享,可在线阅读,更多相关《Windows下自动化部署的救赎.pdf(34页珍藏版)》请在三一文库上搜索。
1、DSC(Desired State Configuration)and Others WINDOWS 下自动化部署的救赎 姚文杰 2 Linux/Unix Windows 设想一个WINDOWS测试开发产品环境的要素 应用(App) 功能(Feature) 服务(Service)及进程(Process) 文件(File) 用户(User)及用户组(Group) 注册表(Registry) 环境变量(Environment Variable) 更多(Others)? 3 WINDOWS项目下QA的日常(除了测试) 4 安装一些应用 管理一些文件 启动一些服务 配置一些工具 部署一些Websit
2、e 其他? 包管理工具 5 LinuxUnixWindows Nuget if(!(Test-Path C:sql_server) & C:Program Files7-Zip7z.exe x C:SQLServer2008.zip -oC: C:sql_serversetup.exe /Confi gurationFile=C:Confi gurationFile.ini xSQLServerSetup MySQLServer SourcePath = * SourceFolder =* SetupCredential = * Features = * InstanceName = * In
3、stanceID = * PID = * UpdateEnabled = * UpdateSource = * 部署网站 25 cAppPool MyAppPool Name = “MyAppPool“ Ensure = “Present“ autoStart = “true“ managedRuntimeVersion = “v4.0“ identityType = “LocalSystem“ startMode = “AlwaysRunning“ MaximumWorkerProcesses = “2“ xWebSite MyWebsite Name = “MyWeb“ Applicati
4、onPool = “MyAppPool“ Ensure = “Present“ PhysicalPath = “C:TestWebSite“ DirectoryBrowsing = “Enable“ BindingInfo = ( (MSFT_xWebBindingInformation Protocol = “HTTPS“ Port = 2001 ) ) State = “Started“ DependsOn = (“WindowsFeatureIIS“, “cAppPoolMyAppPool“) 17步! PS C: MyConfi g #生成一个目录,目录下MyConfi g.mof P
5、S C: Start-DscConfi guration -Wait -Verbose -Path .MyConfi g #执行一个DSC配置 ? QA PS Remoting Http/Https/SMB 1.编写所有需要管理的机器的DSC配置脚本 2.生成及保存对应的MOF文件 3.存放一切需要使用的Resource PC01PC02PC00 PC04PC05PC03 PC07PC08PC06 DSC Server Web APP DB StgProd DSC实现模式 28 Push模式 无实际服务器 部署前,DSC Resource需 要目标机器上 Pull模式需要Pull服务器 DSC
6、 Resource保存在服务 器上,目标节点按需拉取 LOG分析及故障排查 29 Start-DSCConfi guration Verbose Log Resource 关于DSC,你可以. 31 关注社区 The DSC Book (以及本人对该书的中文翻译) https:/www.penfl 下载安装最新版本得WMF 5.0 Preview DSC功能增强,添加Resource库,愈发完善 构想这么一个场景 32 33 Duang! Everything is OK! QA的幸福生活 For questions or suggestions: Yao Wenjie Email: Skype: yoowenjie THANK YOU