Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows services MSDeploy是否要安装windows服务?_Windows Services_Msdeploy_Automated Deploy - Fatal编程技术网

Windows services MSDeploy是否要安装windows服务?

Windows services MSDeploy是否要安装windows服务?,windows-services,msdeploy,automated-deploy,Windows Services,Msdeploy,Automated Deploy,我们有一个使用NServiceBus发布事件的网站。该站点是使用msdeploy部署的。我们还有NServiceBus.exe,它应该作为windows服务运行以订阅这些事件,我们也想部署它 有没有办法将服务和网站打包,以便也可以安装?是否可以单独打包,以便我们可以将其部署到另一台服务器 任何关于在何处查找有关如何执行此操作的信息的提示都将非常有用,因为我们现在可以为网站进行自动部署。我们最终要做的是创建一个“控制器”层来协调部署任务,甚至可以使用msdeploy。本质上,msdeploy不是我

我们有一个使用NServiceBus发布事件的网站。该站点是使用msdeploy部署的。我们还有NServiceBus.exe,它应该作为windows服务运行以订阅这些事件,我们也想部署它

有没有办法将服务和网站打包,以便也可以安装?是否可以单独打包,以便我们可以将其部署到另一台服务器


任何关于在何处查找有关如何执行此操作的信息的提示都将非常有用,因为我们现在可以为网站进行自动部署。

我们最终要做的是创建一个“控制器”层来协调部署任务,甚至可以使用msdeploy。本质上,msdeploy不是我们部署系统中的最高抽象级别

我们选择使用MSBuild来协调从“包”部署项的任务

在我们的部署过程中,使用msdeploy部署的web应用程序只是另一个部署项,就像Windows服务一样

在所有公开的内容中,我们还没有实际创建msdeploy部署任务,尽管它应该/将很好地与我们已经创建的任务一致,因为MSBuild将调用msdeploy。我们目前使用MSBuild社区任务进行webapp部署自动化,并通过MSBuild进行协调


您可以通过我写的一篇名为“”的博客文章,进一步了解我们如何“概括”我们的部署

我最近使用MSDeploy、Phantom和installUtil.exe完成了这项工作

基本上,您只需要修改安装程序类,并在需要时提升远程wmsvc服务权限


这里有一行msdeploy cmd,我用来同步从我的
Windows Service.proj
文件中的后期生成步骤创建的archivedir

它正在不同网络上从我的构建服务器同步到我的应用服务器。我有启动和停止远程服务器上服务的构建前和构建后步骤。由于powershell和msdeploy存在错误,您必须将powershell脚本包装在vb脚本中。
-verbose
选项非常有用

我还有下面的vbscript和ps1脚本。注意VB睡眠和msdeploy前后超时

msdeploy -verb:sync -source:archivedir=\\qa-xxxxx1.qa.lan\deployment\backups\FreddieMacDelivery\FreddieMacDelivery.zip,tempAgent='True',computerName=qa-xxxxx1.qa.lan,userName=QA\xxxxx,password=xxxx,authtype=NTLM,includeAcls='False' -dest:dirpath=\\qa-xxxxxx1.qa.lan\protk\Services\FreddieMacDelivery\1.4.1.test -useCheckSum -verbose -preSync:runCommand="cscript.exe c:\temp\stop_win_svc.vbs" -postSync:runCommand="c:\temp\start_win_svc.vbs",waitInterval=15000,waitAttempts=1
VB脚本:

Option Explicit
Dim oShell, appCmd,oShellExec
Set oShell = CreateObject("WScript.Shell")

appCmd = "powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ""&c:/temp/Get_Win_SVC.ps1"" "

Set oShellExec = oShell.Exec(appCmd)

WScript.Sleep 1000
oShellExec.StdIn.Close()
Powershell脚本:

$username = 'QA\xxxxx'
$password = 'xxxxx'
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))

(Get-WmiObject  -computer qa-xxxx1.qa.lan  -Credential $cred Win32_Service -Filter "Name='ProTeck.FreddieMac.DeliveryService'")


$svc = (Get-WmiObject  -computer qa-xxxxx1.qa.lan  -Credential $cred Win32_Service -Filter "Name='ProTeck.FreddieMac.DeliveryService'") 

Write-Host  $svc

$svc.InvokeMethod("StartService", $null)


(Get-WmiObject  -computer qa-xxxxx1.qa.lan  -Credential $cred Win32_Service -Filter "Name='ProTeck.FreddieMac.DeliveryService'")> c:\temp\win_stat_post.txt

我很感兴趣的是你在这个问题上找到了什么解决方案。不幸的是,我们没有时间找到解决方案,但我希望很快再次回到这个话题。我终于发布了一篇关于我们最终如何做到这一点的博文:你有没有开源你的熊猫产品?没有,但谢谢你的关注!此时,请考虑是否有可用的替代方案(即使在Windows上)来填补该空间(chef、PowerShell DSC、Octopus Deploy)等。