Enable Dark Mode!
how-to-create-and-configure-sub-modules-on-the-odoo-sh.jpg
By: Aswathi pn

How to Create and Configure Sub-modules on the Odoo.sh?

Functional Odoo 15

Odoo sh is a deployment cloud platform, that was managed by Odoo SA. It is a Platform as a Service (PaaS). Mainly the Odoo sh is customized for Odoo implementations. You may quickly install both our approved apps and any other third-party apps offered in the Odoo App store. There are built-in tools that can assist you in creating new applications and unique features.

a) Integration with Github

b) An online editor

c) Continuous integration (your own “runbot”)

d) A development and staging environment

e) Branch management (track, fork, merge, etc.)

f) Automated testing of every new commit etc.

Sub Modules

A record in a host git repository that refers to a particular commit in a different external repository is known as a git submodule. Submodules simply keep track of particular commits and are highly static. When the host repository is updated, submodules are not instantly updated because they do not track git refs or branches.

There are public and private submodules in Odoo SH. Public repositories are those that are accessible to the general public and where adding a submodule is simple and successful. Private repositories are those that are not accessible to the general public, and you must create a deploy key on Odoo.sh before adding it to the remote Github repository. When you manage customer code or work for a firm, you typically have private repositories. 

Uses of Git submodule

Using git submodules can make sense if you need to keep strict version management over your external dependencies. Below are the top applications for git submodules.

You can lock the code to a single commit for your protection when an external component or subproject is changing too quickly or when upcoming changes would disturb the API. 

When you want to track a component as a vendor dependency but it isn't updated frequently.

When a third party is given a portion of a project to complete, and you want to incorporate their work at a particular time or release. Once more, when updates are not too often, this works.

Adding Public repository submodules

It is very easy to do public repository submodules. Go to the git repository and switch to the correct branch and add submodules using the following command.

mkdir git-submodule-demo
cd git-submodule-demo/
git init initialized empty Git repository in new Directory

A new Odoo.sh build will be started with this new commit. Submodules for a private repository are added. Go back to your Odoo.sh project's settings tab and add the connection to your private repository there. You could now make the decision to include the repository in your repository as a submodule. However, there is the further effort required for a private repository. To add the generated key to Github, you must copy it from the Odoo.sh project.copy the key first

how-to-create-and-configure-sub-modules-on-the-odoo-sh-cybrosys

Open "Deploy keys" on the settings page of the repository where the submodule you linked to is hosted, add your own key by choosing "Deploy key," and then save your changes:

how-to-create-and-configure-sub-modules-on-the-odoo-sh-cybrosys

how-to-create-and-configure-sub-modules-on-the-odoo-sh-cybrosys

Now add the key to the next screen and click on “Add key”:

how-to-create-and-configure-sub-modules-on-the-odoo-sh-cybrosys

Odoo.sh may then locate the private repository and retrieve all the data it needs.

Adding the submodule via the command line, committing it, and pushing it to Github are the final steps:

git submodule -b 11.0 add git@github.com:account/private_subrepo.git
git add -A && git commit -m "[ADD] submodule: private repository as submodule"
git push

A new Odoo.sh build will be started with this new commit. Once this build is complete, you will see that the modules from your other private repository are usable on this instance.

Submodules are the way to go if you know how to utilize them and want to test your deployments on Odoo.sh. This blog will very helpful to understand the submodules in odoo sh.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment

 
whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

London

Cybrosys Limited
Alpha House,
100 Borough High Street, London,
SE1 1LB, United Kingdom

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message