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

Bamboo relative submodule urls checkout fails

Beau Herger June 6, 2023

Hello!  We are using Bamboo 9.3 integrated with Bitbucket Cloud.


We have found that when we utilize relative urls in our submodule definitions (.gitmodules), the build can either successfully clone the repo and submodules, or fail to retrieve certain submodules.  This seems to be dependent on the remote build agent.

We presume this is somehow dependent on how the agent and Bamboo server are caching repos? 

Can you explain how Bamboo works in this scenario? 

Are relative submodule urls supported, and if so, is there certain guidance to be understood/followed to enable them properly?

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2023

Hello @Beau Herger,

From version 8.1, Bamboo supports submodules with relative paths natively. That's actually required for Bamboo to manage the Git authentication completely when the "SSH key applies to submodules" is selected after enabling Submodules on the Bitbucket Cloud Linked repository.

Bamboo will try to use the same credentials you have provided to retrieve the submodule data after cloning the main repository:

/usr/bin/git -c credential.helper= -c 'credential.helper=store --file=/tmp/gitCredentialsxxxxxxx.tmp' submodule update --init --recursive

If the provided credentials are not granted access to the referenced submodule, the fetch will fail.

Make sure the credentials you are using on the main repository are also shared with the submodules and it should just work.

Alternatively, if you want to have full control over the credentials you are using, you'll have to switch to the Repository Authentication Type to "SSH private key", then generate an SSH keypair, distribute the public key to both main and submodule repositories and enable the "SSH key applies to submodules" option under the Linked repository's advanced options. Bamboo will then use SSH to communicate with Bitbucket Cloud not HTTP any longer.

Cheers,

 

 

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Beau Herger June 8, 2023

Thank you for the response, Eduardo.  We are already following the suggestions you made with use of "SSH private key" authentication of the repo and "SSH key applies to submodules".    The key pair is applied at the workspace level in bitbucket cloud so there should be clear access without copying keys into submodules.

In the period between my question and response, or problem has seemed to fix itself without any configuration changes.  I will accept the answer to close the question.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events