Bamboo SCP plug-in: how to find directory
Asked Answered
A

1

8

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: SCP

Here is a look from cygwin at my directory: enter image description here

Akela answered 12/9, 2014 at 20:23 Comment(1)
What is the reason for using an absolute path in a build job? Where do the files to upload come from? Are they created by the bamboo job?Watt
W
0

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

Wailful answered 18/9, 2014 at 9:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.