构建后将文件移动到远程文件共享

发布于 2024-07-24 08:01:24 字数 311 浏览 2 评论 0原文

我想创建一个构建后脚本,将文件从构建目录移动到远程 (UNC) 文件共享。

此行:

xcopy "C:\TeamCityBuild\project\WebSite\*" "\\192.168.1.1\WebSite\" /C /R /Y /E

在 DOS 窗口中运行时工作正常,但当 TeamCitys buildrunner sln2008 尝试运行它时,它失败并显示消息“无效的驱动器规范

我已共享具有完全权限的文件夹 '远程服务器上的每个人。

有任何想法吗?

I want to create a post build script that moves files from the build directory to a remote (UNC) file share.

This line:

xcopy "C:\TeamCityBuild\project\WebSite\*" "\\192.168.1.1\WebSite\" /C /R /Y /E

Works fine when it is ran in a DOS-window but when TeamCitys buildrunner sln2008 tries to run it it fails with the message "Invalid drive specification"

I have shared the folder with full rights for 'Everyone' on the remote server.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

三人与歌 2024-07-31 08:01:24

只是一个猜测。 不太确定它是否能解决您的问题。 我们在使用 CruiseControl 并将应用程序部署到远程 JBoss 服务器时遇到了类似的问题。
我们

net use \\192.168.1.1\Website ...

在每个副本之前添加了。 这样它就会在尝试访问远程共享之前“安装”它。 注意:您可能需要指定命令的用户名和密码(有关详细信息,请参阅命令行)。

即使您以手动登录的同一用户身份运行自动化作业,'net use' 似乎也是必需的。 这两种会话似乎不共享远程共享信息。

Just a guess. Not quite sure if it solves your problem. We had a similar problem using CruiseControl and deploying our application to remote JBoss server.
We've added

net use \\192.168.1.1\Website ...

before each copy. So that it 'mounts' the remote share before trying to access it. Note: you probably need to specify the username and password for the command (consult the command line for details).

The 'net use' seems needed even if you run the automated job as the same user you log on manually. These two kinds of sessions seem not to share remote shares information.

初吻给了烟 2024-07-31 08:01:24

我从未使用过 TeamCity Buildrunner sln2008,但如果它作为服务运行,那么它可能在“本地系统”帐户下运行,该帐户没有网络访问权限。 更改服务属性(在“登录”选项卡下),以便服务以有权访问该网络共享的用户身份登录。

I've never used TeamCity Buildrunner sln2008, but if it runs as a service, then it is probably running under the "Local System" account, which doesn't have network access. Change the service properties (under the "Log On" tab) so that the service logs on as a user with permissions to that network share.

酷炫老祖宗 2024-07-31 08:01:24

我不相信它有效,因为代理作为系统服务运行,因此它的网络访问受到限制(我相信)。

我认为您应该考虑使用 TeamCity 的 构建工件。 这就是我们在工作中使用的方法,尽管我们对 TeamCity 也是新手。 我不知道 Build Artifact 系统是否完全符合您的要求。

I don't beleave it works because the agent is running as a system service so it has limited network access (I beleave).

Instead of trying to use a post build step to copy the output, I think you should look into using TeamCity's Build Artifact's. That's what we use at my work altho we are new to TeamCity as well. What I don't know is if Build Artifact system will do extactly what you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文