wolfeidau / rake-bamboo-plugin

Plugin for bamboo which enables building of ruby projects using rake
Other
34 stars 16 forks source link

Capistrano - Prompting for Password only in Bamboo #65

Closed stuartdrennan closed 10 years ago

stuartdrennan commented 10 years ago

Hi

I'm probably missing something here, but when I deploy from my BAMBOO machine via the CLI, even working in the Bamboo working direction, it deploys fine, but when I use the plugin with a Bamboo build project, it hangs waiting for a password.

I've moved keys etc. around, but I just can't see any issue with the deployment.

Would anyone be able to help?

Thanks

Stuart

wolfeidau commented 10 years ago

Gday stuart

What user are you testing the bamboo deploy using?

If the bamboo software is running as say the bamboo user your going to need to ensure that user can use the "keys". I am guessing these are the SSH keys..

Just do something like:

sudo su - bamboo -s /bin/bash 

Then test ssh to ensure the keys work correctly.

stuartdrennan commented 10 years ago

Hi

Thanks for the reply :)

Yeah, they are SSH keys.

Tired that command, everything seems to work on.

I've just re-generated that SSH Keys and can run the deploy manually, using the same command that the plugin is using in the build directly, and it runs fine, but the build can't do it....

Any other thought would be great :)

Stu

stuartdrennan commented 10 years ago

Hi @wolfeidau

I'm getting somewhere. I added the set :password parameter (along with the set :user's password) to the deploy.rb, and it now deploys fine.

I still can't understand why this works perfectly from the command line, logged in as the bamboo user, but bamboo application can't run the same task without it asking for password.

Does this help any? Its maybe a question to take to the capistrano issue board?

Thanks

Stuart

wolfeidau commented 10 years ago

The only difference is that when you do it at the command line you have a full SHELL, with all the information cached in the environment.

I do not run any of the tasks in a shell, primarily because most of the ruby runtime managers taint the shell like no tomorrow. So I am guessing capistrano is expecting a env variable that isn't there when it the process is spawned.

You could output the env from your deploy routine and compare the differences if your interested :)

stuartdrennan commented 10 years ago

Thanks @wolfeidau, you were 100% right. Looks like it might be the HOME variable. In the build project its blank, but in the shell its now. Added it to the cap task, and everything is working again :)

Thanks

Stuart :+1:

wolfeidau commented 10 years ago

Great to hear you got it sorted.