DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building GitOps Pipelines With Helm on OpenShift: Lessons From the Trenches
  • Streamlining AWS Lambda Deployments
  • Zero to Hero on Kubernetes With Devtron
  • AppOps with Kubernetes and Devtron - The Perfect Fit

Trending

  • Workflows vs AI Agents vs Multi-Agent Systems: A Practical Guide for Developers
  • Give Your AI Assistant Long-Term Memory With perag
  • A Spring Boot App With Half the Startup Time
  • How to Submit a Post to DZone
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Deploying Git Submodules in Bitbucket Pipelines

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.

By 
Ayush Sharma user avatar
Ayush Sharma
·
Apr. 22, 20 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
13.9K Views

Join the DZone community and get the full member experience.

Join For Free

Bitbucket 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.

YAML
 




x


 
1
pipelines:
2
  default:
3
    - step:
4
        script:
5
          - git submodule update --init --recursive
6

           


 

The above Pipeline checks out all nested submodules during its execution. We can then use them in subsequent build steps.

 

Deploying git submodules in Bitbucket Pipelines

Pipeline (software) Git

Published at DZone with permission of Ayush Sharma. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Building GitOps Pipelines With Helm on OpenShift: Lessons From the Trenches
  • Streamlining AWS Lambda Deployments
  • Zero to Hero on Kubernetes With Devtron
  • AppOps with Kubernetes and Devtron - The Perfect Fit

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook