Bamboo SCP插件:如何找到目录 [英] Bamboo SCP plug-in: how to find directory

查看:553
本文介绍了Bamboo SCP插件:如何找到目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用SCP任务将文件上传到远程服务器。我在所讨论的远程服务器上配置了OpenSSH,我使用运行Windows Server 2008 R2的Amazon EC2实例运行Bamboo构建服务器。



我的问题是关于找到我想要使用的目录。我想使用SCP上传C:\ doc的全部内容。文档中记录了我必须使用本地路径相对于Bamboo工作目录而不是绝对目录名。



通过在构建计划期间运行 pwd 找到工作目录 / cygdrive / c / build-dir / CDP-DOC-JOB1 。所以要得到doc,我可以运行 cd ../../ doc 。但是,当我在SCP配置下将我的工作目录设置为 ../../ doc / ** (使用这个模式匹配指南),我得到消息没有要上传的文件。








$ b $ $ b

这是我的SCP任务配置:



这是从cygwin在我的目录:

解决方案

您可以添加第一个运行Windows shell的脚本任务,从 C:\doc 到某个本地目录,然后运行scp任务将此新目录的内容复制到远程服务器上

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

那么复制的模式应该是 / doc / **


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:

解决方案

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/**

这篇关于Bamboo SCP插件:如何找到目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆