Deploying Git Submodules in Bitbucket Pipelines
Take a look at this simple tutorial that explains a workaround for the missing capability for Bitbucket Pipelines to clone submodules automatically.
Join the DZone community and get the full member experience.
Join For FreeBitbucket Pipelines is a great deployment tool tightly integrated into Bitbucket. It allows you to trigger deployments directly from repository branches and tags, and you can customize your deployment steps as needed.
One missing feature in Pipelines is that it is not able to automatically clone submodules that are added to your repository as this requires some additional settings. Until this feature gets added by default, there is a simple way to achieve this.
First, we need to make sure our repository has access to clone the sub-modules repository. You can configure this by reading Cloning another Bitbucket repository in Bitbucket Pipelines.
Next, the git submodule update --init --recursive
command can initialize, fetch and checkout any nested submodules. Add it to the beginning of the script
block.
x
pipelines
default
step
script
git submodule update --init --recursive
The above Pipeline checks out all nested submodules during its execution. We can then use them in subsequent build steps.
Published at DZone with permission of Ayush Sharma, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments