使用 teamcity 构建代理中的批处理文件在远程服务器上创建文件夹
我试图通过运行 teamcity 中的批处理文件在远程计算机上创建一个文件夹,然后将源代码复制到该文件夹中,但似乎没有执行。 使用以下代码创建并复制
SET dirTempBackup=\\server1\BackupStorage\temp\test
SET Current=\\server1\web\BuildEnvironment\test
ECHO Starting to copy files.
IF NOT EXIST "%dirTempBackup%" MKDIR "%dirTempBackup%"
IF NOT EXIST "!Current!" (
ECHO ERROR! Not found: !Current!
) ELSE (
ECHO Copying: !Current!
SET Destination=%dirTempBackup%\!Current:~0,1!
REM Directory.
XCOPY "!Current!" "!Destination!" /v /c /i /g /h /q /r /y /e
)
临时目录,稍后压缩它,最后删除它。 Teamcity 正在生成访问被拒绝。由于路径无效,复制失败。已检查 teamcity 用户对该文件夹拥有完全权限。
I am trying to create a folder on a remote machine by running the batch file from teamcity and then copy source into that folder but it seems to be not doing.
Using following code to create and copy
SET dirTempBackup=\\server1\BackupStorage\temp\test
SET Current=\\server1\web\BuildEnvironment\test
ECHO Starting to copy files.
IF NOT EXIST "%dirTempBackup%" MKDIR "%dirTempBackup%"
IF NOT EXIST "!Current!" (
ECHO ERROR! Not found: !Current!
) ELSE (
ECHO Copying: !Current!
SET Destination=%dirTempBackup%\!Current:~0,1!
REM Directory.
XCOPY "!Current!" "!Destination!" /v /c /i /g /h /q /r /y /e
)
using the temp directory as compressing it later and then deleeting it at the end. Teamcity is generating Access is denied. and Copy failing due to Invalid path. Have checked teamcity user has full rights on that folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查源和目标的权限修复了问题。
checking the permissions on both source and destination fixed the problem.