Introduction
Layered modules are designed to allow teams to update and deploy the same metadata across multiple production orgs.
This allows a central team to deploy business wide updates without interrupting the development taking place in the individual orgs.
This is commonly used in cases where a business has a central team that maintains multiple region specific organizations.
Building a Pipeline with layered modules allows teams to layer their shared and org specific metadata together in an easy to understand UI.
Setting up a new repo
1) Create an empty repository in your chosen source control provider. Make sure to initialize it with a Read Me
file as shown below. (I am using GitHub in this example)
2) Connect your source control to Gearset by navigating to My connections
on the left-hand side menu and click on Source control and services.
(More detailed steps are provided here)
3) Navigate to the compare and deploy page and select the main branch of your newly created repo as the target. You should see an option to Set up repository
as shown below:
4) Once you click Set up repository
, it will take you through the setup wizard explained in this document. After reading each step, click Next
.
π‘ At this stage, Gearset will automatically create your core
module.
For GitHub users
5) Create teams in GitHub to match your module names. For example: Core-team
, China-team
, EU-team
etc.
6) Create a CODEOWNERS file in the repo as shown below. This file will prevent non team-members from editing a module that does not belong to them.
Setting up your core module
Now that you have created your repository, it's time to fill it with metadata.
π‘ Note: You don't have to commit all your metadata to setup a baseline, you can add more gradually once the Pipeline has been created. If you want to do this, skip to this step.
1) Run a comparison with your old repo as the source and the new repo as the target. Select the Core
module.
2) Select the metadata that is shared between all the regions. We suggest starting with Standard objects (excluding their sub-components).
3) After deselecting the sub-components, commit the objects to the Core module.
Setting up your layered modules
1) Create a new module to contain your metadata.
2) Run a comparison with the regional orgs repo as the source (if you have one, otherwise use the org itself) and the new repo as the target. Select the layered module (Australia
in this example).
2) Select the metadata that is specific to this region (if you're not sure what this is, feel free to move directly to Pipeline setup). These should all be New
components, to signify that they do not already exist in the core
module.
3) Confirm that this list contains only the name of your layered module, and that all the components are New
.
4) Commit your components.
Next Steps
Once you have created your modules, you will be able to set up a Pipeline to deploy to multiple production orgs.
Check out these articles next: