简体   繁体   English

詹金斯视窗 | 构建 > 执行 Windows 批处理命令 | 如何将文件夹和文件移动到根目录/工作区

[英]Jenkins Windows | Build > Execute Windows Batch Command | How to move folder and files into the Root Directory / Workspace

I could really need some help right now.我现在真的需要一些帮助。

I want to move files (with subfolders and files in it) into the root / workspace of my current jenkins App.我想将文件(其中包含子文件夹和文件)移动到我当前 jenkins 应用程序的根目录/工作区中。 My other batch commands work, for example:我的其他批处理命令有效,例如:

move app laravel moves the app folder and its content into the laravel folder And i think it works without a problem because I can call the absolute folder. move app laravel将 app 文件夹及其内容移动到 laravel 文件夹中 我认为它可以正常工作,因为我可以调用绝对文件夹。

but if I want to move my files "dynamically" using an relative path (move to root): move public/.htaccess ./ it throws an error that it coudn't find the path.但是如果我想使用相对路径“动态”移动我的文件(移动到根): move public/.htaccess ./它会抛出一个错误,它找不到路径。

I also tried the following synonyms for the root directory, but none worked:我还为根目录尝试了以下同义词,但都没有奏效:

.. , $WORKSPACE , %WORKSPACE% , ws , workspace , /workspace/<appname> , <appname> or / .. or \\ im just out of ideas by now. ..$WORKSPACE%WORKSPACE%wsworkspace/workspace/<appname><appname>/ .. 或\\我现在只是没有想法。

Any recommendations?有什么建议吗?

Okay, I solved it...好的,我解决了...

I researched the folder structure and found that one of my earlier trys kinda worked.我研究了文件夹结构,发现我之前的一个尝试有点奏效。 It moved files into the Jenkins/workspace folder.它将文件移动到 Jenkins/workspace 文件夹中。 That wasnt planned but because of that I now knew that some command must have worked!那不是计划中的,但正因如此,我现在知道某些命令一定起作用了!

The command that worked was .. as the destination directory, because it is in the root directory.有效的命令是..作为目标目录,因为它位于根目录中。

So my Solution now was simple:所以我现在的解决方案很简单:

move public\\*.* .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JENKINS-在Windows中更改工作区根目录 - JENKINS - Changing Workspace root directory in Windows 如何在jenkins构建步骤的Windows10批处理命令中转义%? - How to escape % in windows10 batch command in jenkins build step? 如何移动到文件夹并执行Windows命令行调用 - How to move to a folder and execute a Windows command line call Windows批处理脚本,用于将所有文件从Windows中的一个目录移动到另一个目录,并且文件夹中包含空格 - Windows Batch Script to move all files from one directory to another in windows, and folder contains spaces 如何将子目录中的文件批量移动到 Windows 中的一个文件夹下? - How to batch move files in subdirectories down one folder in Windows? 在目录中的所有文件上执行Windows cmd命令 - Execute windows cmd command on all files in directory Windows批处理文件:使用UnixUtils find命令将X分钟之前的文件移动到其他目录 - Windows batch file: move files older than X minutes to a different directory using UnixUtils find command Jenkins执行Windows批处理命令无法更改文件 - Jenkins Execute Windows batch command fails for file change 如何递归执行Windows批处理命令? - How to execute a windows batch command recursively? Windows 批处理命令移动目录中的所有文件夹,但有例外 - Windows batch command to move all folders in a directory with exceptions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM