[英]TeamCity The system cannot find the file specified
I was trying to run a customer script on TeamCity. 我试图在TeamCity上运行客户脚本。 This script is to rename a release tar file previous release to artifactory local directory.
此脚本用于将先前发行版的tar文件重命名为工件本地目录。 Remove the snapshot and date in the name of tar file:
删除tar文件名称中的快照和日期:
ren %teamcity.build.checkoutDir%\target\project-%maven.project.version%-pkg.tar.gz project-%maven.project.version%-%build.counter%-pkg.tar.gz
ren %teamcity.build.checkoutDir%\target\project-%maven.project.version%-pkg.zip project-%maven.project.version%-%build.counter%-pkg.zip
For example, I have a tar file named project-3.0.18-20170324.190100-1.pom
, i want to rename it to project-8.0.18.pom
. 例如,我有一个名为
project-3.0.18-20170324.190100-1.pom
的tar文件,我想将其重命名为project-8.0.18.pom
。
The problem i got now is : 我现在遇到的问题是:
Step 2/2: rename snapshot (Command Line)
[09:59:08][Step 2/2] Starting: C:\BuildAgent\temp\agentTmp\custom_script193311797169104291.cmd
[09:59:08][Step 2/2] in directory: C:\BuildAgent\work\46536700c4bd208f
[09:59:08][Step 2/2] The system cannot find the file specified.
[09:59:08][Step 2/2] The system cannot find the file specified.
[09:59:08][Step 2/2] Process exited with code 1
[09:59:08][Step 2/2] Process exited with code 1
[09:59:08][Step 2/2] Step rename snapshot (Command Line) failed
I am not sure what exactly is the problem. 我不确定到底是什么问题。 why teamcity is looking for the command line in C:\\BuildAgent\\temp\\agentTmp\\custom_script193311797169104291.cmd.
为什么teamcity在C:\\ BuildAgent \\ temp \\ agentTmp \\ custom_script193311797169104291.cmd中寻找命令行。 And why it can not find it?
以及为什么找不到它?
Thanks! 谢谢!
the custom_script193311797169104291.cmd
- a temporary generated file with script you want to execute. custom_script193311797169104291.cmd
一个临时生成的文件,其中包含您要执行的脚本。
just add some echo
commands into your command script to see if it works. 只需在命令脚本中添加一些
echo
命令即可查看其是否有效。
echo workdir=%teamcity.build.checkoutDir%
echo version=%maven.project.version%
echo %teamcity.build.checkoutDir%\target\project-%maven.project.version%-pkg.tar.gz
and check that source file exists... 并检查源文件是否存在...
actually the ren
command reports that file not found. 实际上
ren
命令报告找不到该文件。
nothing about scriptname 关于脚本名称一无所获
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.