Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Git submodule from a public repo in a pipeline

ricksebak
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 5, 2019

I have a bitbucket repository which runs through a pipeline. The repository also has a git submodule. The submodule came from a public repository on github. When I try to update the submodule as part of my pipeline, it fails.

 

# I have this .gitmodules file in the root of my repo:

[submodule "website_content/themes/beautifulhugo"]
path = website_content/themes/beautifulhugo
url = git@github.com:halogenica/beautifulhugo.git

# And in my bitbucket pipeline, I try to update the submodule:

+ git submodule update --recursive --init
Submodule 'website_content/themes/beautifulhugo' (git@github.com:halogenica/beautifulhugo.git) registered for path 'website_content/themes/beautifulhugo'
Cloning into '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo'...
fatal: unable to fork
fatal: clone of 'git@github.com:halogenica/beautifulhugo.git' into submodule path '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo' failed
Failed to clone 'website_content/themes/beautifulhugo'. Retry scheduled
Cloning into '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo'...
fatal: unable to fork
fatal: clone of 'git@github.com:halogenica/beautifulhugo.git' into submodule path '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo' failed
Failed to clone 'website_content/themes/beautifulhugo' a second time, aborting


# The submodule is a public repo, so why is bitbucket pipelines unable to clone this?

 

Anybody know why this fails to clone, when its cloning from a public repository? 

1 answer

1 accepted

1 vote
Answer accepted
ricksebak
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 6, 2019

Using a submodule url that starts with `git@github.com` clones over SSH and requires and SSH key, even though the remote repository is public.

Switching the submodule to use git://github.com/<user>/<repo> works, and presumably HTTPS would also.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events