简体   繁体   English

在多服务器部署中使用BTDF部署运行exe

[英]Running exe with BTDF Deployment in multi-server deployment

I was having one requirement for running some exe after the deployment of BizTalk application. 部署BizTalk应用程序后,我对运行某些exe有一个要求。 I have added the script accordingly in btdf proj file: 我已经在btdf proj文件中相应地添加了脚本:

<Target Name="CustomPostDeployTarget" AfterTargets="Installer">
    <Exec Command="DocAutomation.exe" WorkingDirectory="..\DocAutomation\bin\Debug"></Exec>
</Target>

This is working fine for single server deployment. 这对于单服务器部署工作正常。 Now i want to run this script only on last server or first server in multi server deployment as for now it will run on every server. 现在,我只想在多服务器部署中的最后一台服务器或第一台服务器上运行此脚本,因为现在它将在每台服务器上运行。 How can i do that? 我怎样才能做到这一点?

In the wizard when deploying or undeploying on a server, the checkbox that asks if you're on the first or last server corresponds to setting the environment variable BT_DEPLOY_MGMT_DB to 'true' or 'false'. 在向导中,在服务器上进行部署或取消部署时,询问您位于第一台还是最后一台服务器上的复选框对应于将环境变量BT_DEPLOY_MGMT_DB设置为“ true”或“ false”。

You can add an attribute to the target to use the same setting for your EXE. 您可以将属性添加到目标,以对EXE使用相同的设置。

Condition="'$(BT_DEPLOY_MGMT_DB)' == 'true'"

It will be true for the last server in the group when deploying, and for the first server in the group when undeploying. 部署时,该组中的最后一台服务器将是正确的;取消部署时,该组中的第一台服务器将正确。

If that doesn't do what you need, you can make it conditional on something else, such as the computer name $(COMPUTERNAME). 如果那不能满足您的需求,则可以使其以其他条件为条件,例如计算机名$(COMPUTERNAME)。

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

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