How can I exeucte the "push origin master" git command from inside a Bamboo Script Task

We are trying to build a shared library on one Bamboo Build project, and then push the artifact into a git repository hosted in another STASH/Bitbucket instance.  We can get the repository from STASH for the target git repository by using the "Source Code Checkout" task, and then we attempt the following script:

 

git config user.email "<my-email>"
git config user.name "Bamboo Build Server"
git add --force .\libs\armeabi-v7a

git commit -m "${bamboo.buildResultKey}: Updating Native Libraries from Bamboo build on secure server (Build # ${bamboo.buildNumber})."

git remote remove origin
git remote add origin ssh://git@htlsrv01:7999/myov/myovistaapp.git
git push origin master

 

At run time, we get the following error:

 

23-Sep-2017 16:01:08Host key verification failed.
23-Sep-2017 16:01:08fatal: Could not read from remote repository.
23-Sep-2017 16:01:08 
23-Sep-2017 16:01:08Please make sure you have the correct access rights
23-Sep-2017 16:01:08and the repository exists.
23-Sep-2017 16:01:09On branch remove-native-code
23-Sep-2017 16:01:09nothing to commit, working tree clean

1 answer

0 vote

Execute these command from the agent manually. Once that works, you will be able to do it from the build too.

Almost... I had to also run my Bamboo service as a "Local User" instead of as a "System User".  Once I did this things started working.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,583 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you