Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Running Bamboo Plan to populate repository

ABA June 26, 2016

I am trying to generate a bamboo plan that would populate the Bitbucket repository.

I have created a shell script, that basically runs the git commands in a sequence.  When it comes to below two commands, I get an error

  • git pull origin master
  • git push -u origin master

fatal: could not read Password for 'https://myuserid@git-devserver.company.com': No such device or address 

fatal: could not read Password for ''https://myuserid@git-devserver.company.com': No such device or address

Prior to this, I have a command in the script for       

  • git config http.sslVerify "false"

The sequence of my steps is as below

The above steps work fine.

This is where I get the above errors 

  • git pull origin master

  • git push -u origin master

1 answer

0 votes
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 27, 2016

How are you providing the password?

Normally you get prompted for a password after pull or push when using http. This will not work in Bamboo

Changing your remote to https://myuserid:mypassword@git-devserver.company.com should work or use ssh instead

ABA June 27, 2016

Hi,  thanks.  I am trying to put these commands in a script and trying to run them as a Bamboo plan.  So, if I have to put in the password, it will be plaintext in the script.  Any way to avoid that?

Or, if I should use ssh, do the admins have to set something up for that.  I do not have administrative accesses on the server.  Or in other words, how do I use ssh.  We have just started using Bitbucket ( git ) as a source control in last 2-3 months, so not much of a knowledgebase here.

 

 

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 27, 2016

The password would be plain text indeed. Not sure you can avoid that

For ssh:
You need to generate an ssh key on the Bamboo agent in case you don't have one yet. When generating an ssh key you get 2 files: a private key and a public key. You need to copy the contents of the public key file and add it as a new access key on the admin page of your Bitbucket repository. Make sure to select read+write

Once this is in place  you change to remote to the ssh url instead of http. When pushing and pulling the connection will match your private key file on the Bamboo agent with the one configured on the Bitbucket admin page

More info about generating ssh keys: https://confluence.atlassian.com/bitbucketserver/creating-ssh-keys-776639788.html

ABA June 27, 2016

Sorry, if I appear to be completely clueless about it.

I was getting a similar password error before executing this command

git remote add origin 'https://myuserid@git-devserver.company.com

 So, I added

git config http.sslVerify "false"

 and that error went away.  I was thinking that the same config change would take care of the error for

git pull origin master
git push -u origin master
ABA June 27, 2016

I want to set-up ssh, but encountering some resistance here for creating ssh for the user that runs bamboo.  So, in the meantime, I tried the other suggestion you made userid:password for the remote call but now I get repository https://myuserid:mypassword@git-devserver.company.com not found.

 

What else do I need to do to get this moving further?

 

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 29, 2016

Strange

Are you sure your url is correct? It doesn't look like a Bitbucket url

It should look like this:  http://myuserid:mypassword@git-devserver.company.com/scm/yourprojectkey/yourreponame.git When you go to your Bitbucket repo via the browser you'll find a Clone menu item in the sidebar. Copy the http variant to your clipboard and don't forget to add the password.
Hope that helps

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events