简体   繁体   English

TeamCity在部署后运行

[英]TeamCity run after deployment

I make the deployment site with TeamCity. 我使用TeamCity创建部署站点。 Today there is a need to deploy the WCF service running in a console application. 如今,需要部署在控制台应用程序中运行的WCF服务。 I see it this way: a .ps1 deployment script which stop my service process, copy new files to the service app dir, adding task to scheduller to run the console application on startup, run tasks manualy. 我这样看:一个.ps1部署脚本,该脚本停止我的服务进程,将新文件复制到服务应用程序目录,向scheduller添加任务以在启动时运行控制台应用程序,手动运行任务。 But buildAgent user (which make deploy) have to privileges to use scheduller. 但是buildAgent用户(进行部署)必须具有使用scheduller的特权。

Is there simple way to start deployed application under SYSTEM or just another user? 有没有简单的方法可以在SYSTEM或其他用户下启动已部署的应用程序?

Sure, just use runas. 当然,只需使用符文。

runas /user:useraccount@domain.com "c:\folder\yourprogram.exe"

Or lsrunas http://www.moernaut.com/default.aspx?item=lsrunas 或lsrunas http://www.moernaut.com/default.aspx?item=lsrunas

Or lsrunase: http://www.moernaut.com/default.aspx?item=lsrunase 或lsrunase: http : //www.moernaut.com/default.aspx? item = lsrunase

Or you could create a service which is starting the program. 或者,您可以创建一个正在启动程序的服务。 But this is a more complicated approach. 但这是一种更复杂的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM