Bamboo On Demand SCP Task - Deploy to Server

gm90 July 5, 2013

Afternoon,

I'm trying to use the bamboo SCP Task to deploy a checked out version of my app (Node) from bitbucket onto a remote amazon cloud server.

I have set up 3 plans. One to shutdown the app and another to bring it back up. These two both use the ssh task's and work flawlessly.

My 3rd plan for deployment has a number of tasks:

  1. Stop any running instances of the app
  2. Remove existing files on the remote server
  3. Checkout from Bitbucket
  4. SCP this directory to the remote server

The job actually runs successfully however looking at the server the app has not reached the designated folder, or anywhere else as far as I can see.

We use key without passphrase for authentication and I'm using the same file as used for the SSH tasks mentioned above.

In the logs I have added a simple "ls dir" script inbetween the checkout and the SCP task to confirm that the code has actually been checked out (This step was to also ensure I was entering the right folder in the 'Local path' field). Sure enough this brings back a list of files I'd expect to be brought back.

Here's a snippet from the logs to show it does hit the task but doesn't seem to do anything:

simple	06-Jul-2013 10:16:12	Starting task 'Print Contents' of type 
.....
build	06-Jul-2013 10:16:12	config.json
build	06-Jul-2013 10:16:12	initproject.bat
build	06-Jul-2013 10:16:12	Makefile
build	06-Jul-2013 10:16:12	models
build	06-Jul-2013 10:16:12	package.json
build	06-Jul-2013 10:16:12	server.js
build	06-Jul-2013 10:16:12	static
build	06-Jul-2013 10:16:12	test
build	06-Jul-2013 10:16:12	views
simple	06-Jul-2013 10:16:12	Finished task 'Print Contents'
simple	06-Jul-2013 10:16:12	Starting task 'Copy files to the server' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask'
simple	06-Jul-2013 10:16:13	Finished task 'Copy files to the server'

Spent over a day now messing about with it and can't seem to get anywhere with it.

P.S I've also tried messing with git archive through the SSH tasks but can't seem to get this to work either as I'm unable to pass the key in directly to the command. Obviously on a local machine I can ref the key file but on the elastic instances I have nowhere to keep it.

As a last resort I've thought about checking the key in to the actual app, as I could reference it to do scp using the script interface (I tried using the script tasks instead but it failed due to a key needing to be provided, it did appear to have at least tried though as I received this information on the logs, unlike the official task). I don't really want to go down this route and can envisage security peeps having a field day.

Any suggestions would be greatly appreciated.

Thanks,

Gary

1 answer

0 votes
LucasA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 5, 2013

Hi Gary,

We have some issues with SCP task. Please put your SCP action inside a shell script and run it as a script task.

Cheers,

Lucas Lima

gm90 July 6, 2013

Hi Lucas,

Thanks for your response, much appreciated.

In that case could you suggest how to use a rsa certificate from within the script? Is it possible to store it in Bamboo anywhere?

Thanks,

Gary

Michael Favia June 20, 2014

Did you ever figure this out? It seems a little crazy that this is so difficult. Its kind of the whole point of using bamboo for us right now. Ive tried "SCP tasks" and "scripts" with the same non encrypted ssh key issues of not being able to speciy it in the command line and it not working in the scp copy operation (it makes just the one base directory).

Ivan Scattergood February 18, 2016

Did you figure this out? I am trying to use an SCP task to deploy a JAR file and I am getting a timeout exception.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events