使用TFS RM进行Windows服务部署 [英] windows service deployment using TFS RM

查看:78
本文介绍了使用TFS RM进行Windows服务部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用vNext Build和RM部署Windows服务项目?

How to Deploy Windows Services project using vNext Build and RM ?

谢谢&问候

推荐答案

我使用RM来部署一个由4个Windows NT服务,一个网站和一个MongoDb组成的项目。  ;我对RM来说是全新的,但是我在门外试过的东西对我的目的来说很好。我倾向于总是将PowerShell放在我的
构建定义和我的发布定义的顶部。我还使用PowerShell脚本打包我的drop(从我的构建PowerShell脚本调用)。 然后我有另一个PowerShell脚本,用于从放置布局部署项目。该脚本是将
连接到我的发布定义中的内容。我的部署PowerShell脚本采用了一个'What'参数,可以是WebOnly,Everything或NtServicesOnly。我使用webdeploy用于web应用程序和nt服务我只是保持它非常简单并使用robocopy命令来移动
的东西从我的drop到目标,并使用标准的* -Service PowerShell命令来停止/部署/启动脚本中的服务。这是脚本只是为了说明。 这不是花哨但似乎做我需要的。

I used RM to deploy a project that consisted of 4 Windows NT services, a web-site, and a MongoDb.  I was completely new to RM but what I tried out of the gate worked fine for my purposes. I have tended to always put PowerShell at the top of both my build definitions and my release definitions. I also package up my drop with a PowerShell script (called from my build PowerShell script).  Then I have another PowerShell script for deploying the project from the drop layout. That script is what is wired into my release definition. My deploy PowerShell script takes a 'What' argument which can be WebOnly, Everything or NtServicesOnly. I used webdeploy for the web app and for the nt services I just kept it really simple and used robocopy commands to move stuff from my drop to the target and used standard *-Service PowerShell commands to stop/deploy/start the services from the script. Here is the script just to illustrate. This isn't fancy but it seems to do what I needed.

<#
.SYNOPSIS
Updates the Contract Analysis software in Stress or Prod.
	
.PARAMETER Environment
You may specify Prod (GeckoTl9) or Stress (ManderTl5)

.PARAMETER Config
This is the build config type (Release or Debug) that you wish to deploy. Default is Release.

.PARAMETER What
You may deploy just the web components (which consists of the SPA front-end plus the REST API), just the back-end Windows NT services, or everything.
.Example
Deploy-Contract -Environment Prod -What WebOnly
.Example
Deploy-Contract -Environment Stress -What Everything
#>
[CmdletBinding()]
Param
(
[Parameter(Mandatory=


true)]
[ValidateSet('压力','产品')]
[string]
true)] [ValidateSet('Stress', 'Prod')] [string]


环境='压力',
[参数(强制性=
Environment = 'Stress', [Parameter(Mandatory=


这篇关于使用TFS RM进行Windows服务部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆