团队城市 + MSBuild:具有访问权限的部署
需要编写用于将网站部署到共享目录的脚本。但访问该目录需要输入登录名/密码。我该怎么做?
MSBuild 配置部分:
<PropertyGroup Condition="'$(SERVER)'=='DEV'">
<DeploymentFolder>\\server\dir$</DeploymentFolder>
<CopyConfig>dev.web.config</CopyConfig>
<ZipFile>webSite.zip</ZipFile>
</PropertyGroup>
在哪里以及如何指定允许 TeamCity 将网站部署到选定目录的登录名和密码?
PS 我无法使用部署中应使用的相同访问权限运行 TeamCity。
Need to write the script for deploying of web site to shared directory. But for access to this directory needs enter login/password. How can i do it?
The part of MSBuild config:
<PropertyGroup Condition="'$(SERVER)'=='DEV'">
<DeploymentFolder>\\server\dirlt;/DeploymentFolder>
<CopyConfig>dev.web.config</CopyConfig>
<ZipFile>webSite.zip</ZipFile>
</PropertyGroup>
Where and how i can specify login and password which allow TeamCity deploy web site to selected directory?
P.S. i cant run TeamCity with same access rights that should used in deploying.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 DOS“net use”命令将远程服务器目录映射到驱动器号,如下例所示:
You could probably use the DOS "net use"-command to map the remote server directory to a drive letter as in this example:
在正确的帐户下运行一个额外的构建代理怎么样?
另一个想法可能是编写一个在指定目录上执行操作的 MSBuild 任务。在此任务中,您可以使用正确的凭据。
=== 编辑 ===
还有一个想法:编写一个小工具,使用正确的凭据执行
msbuild
。使用命令行运行程序并执行该包装工具,而不是使用 TeamCity 中的 MSBuild RunnerWhat about an additional Build-Agent that runs under the right Account?
Another idea could be to write a MSBuild Task that performs the actions on the specified Directory. And in this Task you could use the right credentials.
=== edit ===
Yet another idea: Write a tiny tool that executes
msbuild
with the correct credentials. Instead of using the MSBuild Runner from TeamCity use the Command Line runner and execute that wrapper tool