Include an External Repository (Submodules)
You may want to include modules from another repository, such as an OCA community module or a shared library, in your Skysize deployment. Skysize initializes Git submodules for you on every deployment. Public submodules need no setup. Private submodules get their own read-only deploy key, declared once in the project settings.
Add a public submodule
From a local clone of your repository, add the submodule and push:
# Add a public repository as a submodule
git submodule add https://github.com/OCA/web.git external/oca-web
git commit -m "Add OCA web submodule"
git push
On the next deployment, Skysize initializes the submodule automatically, so the modules inside it are present in the deployed checkout.
Add the submodule from the command line (git submodule add). The GitHub/GitLab web editors can't create a valid submodule, editing .gitmodules by hand in the browser does not register the submodule link.
Make the modules discoverable
Skysize scans your repository one level deep for Odoo modules (each immediate subdirectory that contains a __manifest__.py). If your submodule places modules deeper than that, point Odoo at the submodule's directory using the Custom addons path field, see Organize Modules in Nested Directories.
Private submodules
A private sub-repository cannot be cloned with the project's deploy key, since that key is only installed on the project repository. Skysize generates a separate read-only deploy key for each private submodule, exactly as Odoo.sh does, and installs it on the sub-repository for you whenever it can.
- Open your project, go to Settings, then Private submodules.
- Paste the SSH URL of the sub-repository, for example
git@github.com:USERNAME/REPOSITORY.git, and click Add. - If the project has a Git connection with admin rights on the sub-repository, the key is installed automatically and the entry shows Deploy key installed. You are done.
- Otherwise the entry shows the public key to add by hand: on the sub-repository, go to Settings → Deploy keys (GitHub), Settings → Repository → Deploy keys (GitLab) or Repository settings → Access keys (Bitbucket), add the key with read-only access, then click Retry or simply redeploy.
Then add the submodule to your repository as usual:
git submodule add git@github.com:USERNAME/REPOSITORY.git external/private-addons
git commit -m "Add private addons submodule"
git push
The URL in .gitmodules may be the SSH or the HTTPS form of the same repository, Skysize matches either. Nested submodules inside a private submodule are cloned with the same key only if they are public.
The same mechanism applies on managed hosting and on Bring Your Own Server: the key travels to the server with each build and never leaves it afterwards. Removing the entry revokes the key on the provider when it was installed automatically.
Alternative: vendor the code
If you prefer not to depend on a submodule at all, copy the modules directly into your own repository so they're part of the normal clone:
git clone --depth=1 https://github.com/OCA/web.git /tmp/oca-web
cp -r /tmp/oca-web/web_responsive ./web_responsive
cp -r /tmp/oca-web/web_no_bin_size ./web_no_bin_size
git add web_responsive web_no_bin_size
git commit -m "Vendor OCA web modules"
git push
Because the modules are now committed in your repository, they're present in every deployment with no extra configuration. To update them, repeat the copy, commit, and push.
Install the module in Odoo
Modules made available by a submodule or vendored code are not installed automatically.
- Open your Odoo instance.
- Enable developer mode: Settings → Activate the developer mode.
- Go to Apps, click Update Apps List, then search for your module and click Install.