Bamboo SCP plug-in: how to find directory

南笙酒味 提交于 2020-01-14 07:50:10

问题


I am trying to upload a file to a remote server using the SCP task. I have OpenSSH configured on the remote server in question, and I am using an Amazon EC2 instance running Windows Server 2008 R2 with Cygwin to run the Bamboo build server.

My question is regarding finding the directory I wish to use. I want to upload the entire contents of C:\doc using SCP. The documentation notes that I must use the local path relative to the Bamboo working directory rather than an absolute directory name.

I found by running pwd during the build plan that the working directory is /cygdrive/c/build-dir/CDP-DOC-JOB1. So to get to doc, I can run cd ../../doc. However, when I set my working directory under the SCP configuration as ../../doc/** (using this pattern matching guide), I get the message There were no files to upload. in the log.

C:\doc contains subfolders as well as a textfile in the root directory.

Here is my SCP task configuration:

Here is a look from cygwin at my directory:


回答1:


You may add a first "script" task running a Windows shell, that copies everything from C:\doc to some local directory, and then run the scp task to copy the content of this new directory onto your remote server

mkdir doc 
xcopy c:\doc .\doc /E /F

Then the pattern for copy should be /doc/**



来源:https://stackoverflow.com/questions/25816278/bamboo-scp-plug-in-how-to-find-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!