简体   繁体   English

TeamCity系统找不到指定的文件

[英]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.

相关问题 wshShell.Exec错误80070002“系统找不到指定的文件” - wshShell.Exec Error 80070002 “The system cannot find the file specified” 在Spring Shell中运行date命令(“无法运行程序……系统找不到指定的文件”) - Run the date command in Spring Shell (“Cannot run program … the system cannot find the file specified”) Java执行shell命令-错误[无法运行程序“sh”:CreateProcess错误=2,系统找不到指定的文件] - Java execute shell command - error [Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified] vb.net 找不到指定的文件“”C:\\Users“” - vb.net Cannot find file specified “”C:\Users“” 在Python中使用subprocess.call('dir',shell = True)时找不到指定的文件 - Cannot find the file specified when using subprocess.call('dir', shell=True) in Python sed找不到文件 - sed cannot find file 脚本找不到现有文件 - Script cannot find existing file 有没有办法在Shell脚本中修改TeamCity系统属性? - Is there a way to modify TeamCity system properties in a shell script? 查找所有.h文件并将其放入具有相同结构的指定文件夹的脚本? - Script to find all .h file and put in specified folder with same structure? 使用find,file和upx的系统范围的elf压缩脚本 - system wide elf compression script using find, file, and upx
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM