you'll need to reconfigure the git remote to pull from Bitbucket. Pipelines uses an O-auth token to do the initial cloning which is then destroyed immediately afterwards.
First you'll want to create an app-password for the user who's going to access the submodules (App passwords are here in Bitbucket Cloud | Bitbucket Blog). This will ensure you can work with 2fa enabled on the account.
Then you'll need to provide the username and app-password as Bitbucket Pipelines variables (https://confluence.atlassian.com/display/BITBUCKET/Environment+variables+in+Bitbucket+Pipelines)
assuming you've named them
PASSWORD, add this step to the start of your pipeline:
git remote set-url origin https://$USERNAME:$PASSWORD@bitbucket.org/team/repo.git
followed by initialising your submodules
git submodule update --init
Hi I have tried 20+ times but until the `git submodule update --init` step, it always said:
+ git submodule update --init Submodule 'dev/scripts/api' (firstname.lastname@example.org:team/services.git) registered for path 'dev/scripts/api' Cloning into 'dev/scripts/api'... Warning: Permanently added 'bitbucket.org' (RSA) to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. fatal: clone of 'email@example.com:team/services.git' into submodule path 'dev/scripts/api' failed
Anyone has experienced this?
That isn't enough.
If your submodules point at an ssh Bitbucket url (firstname.lastname@example.org:org/repo.git), you need to change the url of the submodule as well. I did it like this:
git config --file=.gitmodules submodule.$SUBMODULENAME.url https://$USERNAME:$PASSWORD@bitbucket.org/org/repo.git
Then it's the standard git submodule update --init.
This feels like a massive missing feature in BB Pipelines and I hope it gets resolved in future updates!
Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...
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!
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