Salto for
Salesforce
Articles
SHARE
Pablo Gonzalez
October 19, 2022
7
min read
Salesforce architects should be involved in the release strategy of a Salesforce org, and this includes having some oversight on how changes will flow from one environment to another and what version control model will be used.
Most of this translates to configuring what is known as a CI/CD (Continuous Integration/Continuous Delivery) pipeline. Before we get into the specifics, let’s cover some basic terminology.
CI is a software development practice where developers commit changes frequently to a branch on a remote repository. Every time a commit is made, the code gets built and unit tests are executed. The idea is to end up with a simple “pass” or “fail” output. In other words, did your change break any existing functionality (fail), or does it play well with the existing code (pass)?
This helps the developers get feedback as quickly as possible so that they can make any changes necessary to make their code play well with the rest of the implementation.
Continuous Delivery is the ability to get changes of all types into production safely and quickly, in a sustainable way. The goal is to make deployments predictable by ensuring our sdfx projects are always in a deployable state.
Continuous delivery rests on three foundations: configuration management, continuous integration, and continuous testing.
A common term you’ll see often is a CI/CD pipeline. I like to call this a Salesforce deployment pipeline just to make it a bit more specific.
A Salesforce deployment pipeline is an automated process that runs your salesforce metadata through a series of steps, such as quality checks, unit tests, and deployments. This process fires in response to events in your version control repository (for example, when a commit is made, as we saw in the definition of CI).
Each successful step increases confidence in our implementation, and eventually, we end up with something we feel confident can and should be deployed to production.
When implementing CI/CD for your Salesforce team, it's very easy to just jump into configuring git, creating some diagrams, etc.
But to have a successful Salesforce CI/CD implementation that works for your Salesforce team and not against it, you need to ensure its foundations are solid.
In this article, I'll share my checklist of items I think you should consider before implementing CI/CD for your Salesforce org.
I will not be sharing what I think you should be doing. Instead, it's all about what questions you should be asking yourself; how you answer those questions will become the foundation for your Salesforce CI/CD strategy.
Things to consider:
The sandbox strategy has cascading effects in the entire Salesforce deployment pipeline, so make sure to have a justification for every decision you make here.
At the core of CI/CD is having your sfdx project in a remote git repository. Things to consider:
You don't need to track everything in git. Instead, you can start with a basic set of Salesforce metadata to begin practicing your CI/CD workflow and work your way up.
Your git branching strategy is somewhat closely aligned with your sandbox strategy. There are many git branching strategies to choose from. I recommend asking yourself the following questions:
The Continuous Integration (CI) server is what kicks off the Salesforce deployment pipeline by listening to events in your remote git repository.
Typical CI servers are:
Here are some questions you should ask yourself:
The idea of a Salesforce deployment pipeline is to be able to automate many actions in your release process, such as deployment, unit tests, static code analysis, etc.
But you don't have to automate everything, nor should you include automations simply because everyone else is doing it.
You should ask yourself:
Having decided what to automate, the next step is to determine when these automations should run. Remember that your CI server runs actions in response to events in your remote git repository.
I recommend you think about:
After you go through the above exercises, the final step is configuring your deployment pipeline configuration file. This is typically done with YAML.
Here's an example of the YAML file I use for my Salesforce projects, complete with comments explaining everything.
YAML configuration for Salesforce org-based development
This part can be a little overwhelming as you need knowledge of YAML, bash, Node.JS, and the Salesforce CLI.
To simplify this process, I created NaCi (Not another CI tool), a web-based tool that helps you declaratively create a pipeline configuration file in less than 5 min!
You can access it right now at ci.salto.io
It's so easy to use that I will let you explore it yourself. You'll have an entire Salesforce deployment pipeline ready to go in minutes.
At the time of this writing, the tool is still in beta and only supports GitHub Actions, but support for more CI servers is in the works.
Some scenarios are hard to satisfy using your own CI/CD implementation. Such as
Some of the above can be done with a custom CI/CD solution, but it’s much more complex, and it will eat up developer resources in maintaining complicated scripts and troubleshooting deployment issues.
When things get to a certain scale, it may make sense to use a DevOps platform such as Salto. Salto’s CI/CD solution supports all the challenges described above and can be plugged into any existing CI/CD pipeline you may have in GitHub Actions, BitBucket Pipelines, etc. It can also include any configuration data in your pipeline. Other solutions exist as well.
The point here is that you should recognize when to use an in-house solution vs. an off-the-shelf one. All the steps in the checklist are 100% relevant regardless of which path you choose.
And that’s it. Having gone through the above checklist, you can ensure your CI/CD pipeline is well thought out. Did I miss anything? Connect with me and let me know!
Salto for
Salesforce
Salesforce
SHARE
Pablo Gonzalez
October 19, 2022
7
min read
Salesforce architects should be involved in the release strategy of a Salesforce org, and this includes having some oversight on how changes will flow from one environment to another and what version control model will be used.
Most of this translates to configuring what is known as a CI/CD (Continuous Integration/Continuous Delivery) pipeline. Before we get into the specifics, let’s cover some basic terminology.
CI is a software development practice where developers commit changes frequently to a branch on a remote repository. Every time a commit is made, the code gets built and unit tests are executed. The idea is to end up with a simple “pass” or “fail” output. In other words, did your change break any existing functionality (fail), or does it play well with the existing code (pass)?
This helps the developers get feedback as quickly as possible so that they can make any changes necessary to make their code play well with the rest of the implementation.
Continuous Delivery is the ability to get changes of all types into production safely and quickly, in a sustainable way. The goal is to make deployments predictable by ensuring our sdfx projects are always in a deployable state.
Continuous delivery rests on three foundations: configuration management, continuous integration, and continuous testing.
A common term you’ll see often is a CI/CD pipeline. I like to call this a Salesforce deployment pipeline just to make it a bit more specific.
A Salesforce deployment pipeline is an automated process that runs your salesforce metadata through a series of steps, such as quality checks, unit tests, and deployments. This process fires in response to events in your version control repository (for example, when a commit is made, as we saw in the definition of CI).
Each successful step increases confidence in our implementation, and eventually, we end up with something we feel confident can and should be deployed to production.
When implementing CI/CD for your Salesforce team, it's very easy to just jump into configuring git, creating some diagrams, etc.
But to have a successful Salesforce CI/CD implementation that works for your Salesforce team and not against it, you need to ensure its foundations are solid.
In this article, I'll share my checklist of items I think you should consider before implementing CI/CD for your Salesforce org.
I will not be sharing what I think you should be doing. Instead, it's all about what questions you should be asking yourself; how you answer those questions will become the foundation for your Salesforce CI/CD strategy.
Things to consider:
The sandbox strategy has cascading effects in the entire Salesforce deployment pipeline, so make sure to have a justification for every decision you make here.
At the core of CI/CD is having your sfdx project in a remote git repository. Things to consider:
You don't need to track everything in git. Instead, you can start with a basic set of Salesforce metadata to begin practicing your CI/CD workflow and work your way up.
Your git branching strategy is somewhat closely aligned with your sandbox strategy. There are many git branching strategies to choose from. I recommend asking yourself the following questions:
The Continuous Integration (CI) server is what kicks off the Salesforce deployment pipeline by listening to events in your remote git repository.
Typical CI servers are:
Here are some questions you should ask yourself:
The idea of a Salesforce deployment pipeline is to be able to automate many actions in your release process, such as deployment, unit tests, static code analysis, etc.
But you don't have to automate everything, nor should you include automations simply because everyone else is doing it.
You should ask yourself:
Having decided what to automate, the next step is to determine when these automations should run. Remember that your CI server runs actions in response to events in your remote git repository.
I recommend you think about:
After you go through the above exercises, the final step is configuring your deployment pipeline configuration file. This is typically done with YAML.
Here's an example of the YAML file I use for my Salesforce projects, complete with comments explaining everything.
YAML configuration for Salesforce org-based development
This part can be a little overwhelming as you need knowledge of YAML, bash, Node.JS, and the Salesforce CLI.
To simplify this process, I created NaCi (Not another CI tool), a web-based tool that helps you declaratively create a pipeline configuration file in less than 5 min!
You can access it right now at ci.salto.io
It's so easy to use that I will let you explore it yourself. You'll have an entire Salesforce deployment pipeline ready to go in minutes.
At the time of this writing, the tool is still in beta and only supports GitHub Actions, but support for more CI servers is in the works.
Some scenarios are hard to satisfy using your own CI/CD implementation. Such as
Some of the above can be done with a custom CI/CD solution, but it’s much more complex, and it will eat up developer resources in maintaining complicated scripts and troubleshooting deployment issues.
When things get to a certain scale, it may make sense to use a DevOps platform such as Salto. Salto’s CI/CD solution supports all the challenges described above and can be plugged into any existing CI/CD pipeline you may have in GitHub Actions, BitBucket Pipelines, etc. It can also include any configuration data in your pipeline. Other solutions exist as well.
The point here is that you should recognize when to use an in-house solution vs. an off-the-shelf one. All the steps in the checklist are 100% relevant regardless of which path you choose.
And that’s it. Having gone through the above checklist, you can ensure your CI/CD pipeline is well thought out. Did I miss anything? Connect with me and let me know!