Git Submodules
This page explains how you can keep using Git Submodules while deploying apps with ShamanOps.
Pre-requisites
- Add the following secret as a variable in your CI platform:
Create a token in your CI platform and grant it read permissions on the repositories that you will use as submodules.
shamanops_submodules_token
*
The is value refers to the token with read permissions on the repositories that you will use as submodules.
Usage
- GitHub Actions
- GitLab CI
- Bitbucket Pipelines
1. In the main branch you will edit the YAML file named .github/workflows/github-ci.yaml
2. In the github-ci.yaml file search for the Features section, you will find it like this:
## Features -------------------------------------------------------------------------------------#
3. Bellow the section title, add the following configuration and change the values as you need:
# Git Submodules
git_submodules_enabled: 'true'
4. In the github-ci.yaml file search for the secrets: section, you will find it like this:
#-------------------------------------------------------------------------------------------------#
secrets:
5. Bellow the section title, add the following configuration:
shamanops_submodules_token: ${{ secrets.shamanops_submodules_token }}
6. Commit and enjoy! ✨
1. In the main branch you will edit the YAML file named .gitlab-ci.yml
2. In the .gitlab-ci.yml file search for the Features section, you will find it like this:
## Features -------------------------------------------------------------------------------------#
3. Bellow the section title, add the following configuration and change the values as you need:
# Git Submodules
git_submodules_enabled: 'true'
4. Commit and enjoy! ✨
You should use the following .gitmodules file structure:
[submodule "module-name"]
path = module-name
url = https://${shamanops_submodules_token}@git-platform-url/org-name/module-name.git
branch = branch-name
- Replace only: module-name, git-platform-url, org-name and branch-name
Example:
[submodule "api-email"]
path = api-email
url = https://${shamanops_submodules_token}@github.com/HiperCompuMegaRed/api-email.git
branch = main
1. In the main branch you will edit the YAML file named .bitbucket/envs.yaml
2. In the .bitbucket/envs.yaml file search for the Features section, you will find it like this:
## Features -------------------------------------------------------------------------------------#
3. Bellow the section title, add the following configuration and change the values as you need:
# Git Submodules
git_submodules_enabled='true'
4. Commit and enjoy! ✨
You should use the following .gitmodules file structure:
[submodule "module-name"]
path = module-name
url = https://${shamanops_submodules_token}@git-platform-url/org-name/module-name.git
branch = branch-name
- Replace only: module-name, git-platform-url, org-name and branch-name
Example:
[submodule "api-email"]
path = api-email
url = https://${shamanops_submodules_token}@github.com/HiperCompuMegaRed/api-email.git
branch = main