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
Newsletter
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

  • Why AI Agents Need a Shared Enterprise Ontology
  • Testing Java and Spring Applications With Kotlin: Low-Risk to Adoption
  • Build a Voice Assistant With Gemini Live API
  • Should Developers Switch From SQLite to DuckDB?

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Apr. 22, 20 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
14.0K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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