In times when the search for maximum optimization of time and processes is crucial, companies need to adapt their software development lifecycle to be efficient and competitive. They need to create a fluid set of development operations (DevOps) combining different stages: Plan & Design, Code & Build, Test, Release, Deploy, Operate & Monitor. That’s where Continuous Integration comes in! Curious? Just keep reading!
To implement a fluid software development lifecycle more than one environment is needed. You’ll need at least three environments:
- Development: Where the Code & Build happens, as well as unit tests by developers, ensuring the requirements are being met and the new code is not breaking other developers work.
- UAT (User Acceptance Testing): Where the majority of tests and validation should be made.
- Production: The live version of the software.
Success Factor: Continuous Integration!
Guaranteeing smooth transitions between environments may be a hard task. To make it easier for you, Continuous Integration is the key to success. “What does that mean?”, you may ask. Well, Continuous Integration is what gives you the opportunity of working multiple stages at the same time. By having continuous integration of the developments between Development and UAT environments, we can Build and Test at the same time.
Source: Salesforce
Deployment Tool:
In Salesforce there are two ways of deploying code from the Development environment to upper environments: Change Set and Metadata API. Let’s check each one of them!
Change Set is a user interface-based method, inside Salesforce, of creating a Package. It is a very time-consuming process since you need to make several clicks and to browse through a list of pages just to add one component to the Change Set. A common development project can easily reach more than 200 customized components in a 3-week sprint! Can you imagine the struggle of having to memorize and select all the components you created/changed during the sprint? Quite demanding, right?
Metadata API, on the other hand, is intended to manage customization and easily deploy or retrieve the metadata model of a Salesforce Org. The easiest way to access the functionalities provided by Metadata API is to use script-based tools such as Force.com IDE or Ant Migration Tool.
- Force.com IDE is built on the Eclipse platform, for programmers who are comfortable with integrated development environments. Just code, compile, test, and deploy from within the IDE.
- The Ant Migration Tool is ideal if you use a script or the command line for moving metadata between a local directory and a Salesforce Org.
We have now seen which are the possibilities of moving changes between environments in Salesforce! Let’s move to other DevOps tools that are also very helpful and another gear in the application development lifecycle. Shall we?
Version Control System:
It is true that a Salesforce Org can work as Code Repository, but it does not keep versions. That is why a Version Control System is very helpful to track changes and customize of your Salesforce Org. Git is the most used Version Control System nowadays, there are several hosting platforms providing enhanced features such as GitLab, GitHub or BitBucket.
By working with Git you unlock several possibilities, such as:
- Track all modifications in your code, see when and who has modified every line of code.
- Look back on how your code was on anytime in history.
- Create separate branches for each developer.
- Merge developer changes
- Ability to manage code conflicts, if they happen.
- Create baseline branches for each environment.
- Easily compare differences between each environment.
Git is a keeper! Just start using it if you are not yet doing so. It really is a developer’s best friend!
Continuous Integration Platform:
We can use Git and Ant Migration Tool using the command line. However, there are Continuous Integration Platforms where we can configure an automation process where both tools are combined. The most used platforms for this purpose are Jenkins, Travis CI, and also Bamboo.
Jenkins is an open source automation tool with several plugins available for continuous integration purpose. It can be either installed on a server or locally, and it even has a friendly web interface that makes it accessible to anyone to configure it. In Jenkins, you can configure a job, which is a combination of different tasks in the order you define, and you can also set this job to run on a specific time or to be triggered by an external event, like a push to your Git repository.
For example, using Jenkins it is possible to wire Git and Ant Migration tool in a single job. By setting scheduling jobs we can retrieve daily Salesforce org changes, or even get changes of a given developer in the last two weeks. Another use case is to read metadata file’s differences in Git, the Version Control System, check which metadata/code is new and package these features. This is when Ant Migration Tool comes in play to use Metadata API and move the package into the next environment.
Below is an example of how Git and Ant Migration Tool can work together in the Salesforce development lifecycle.
Make the move for Continuous Integration!
Wire it all together and you will definitely start to see improvements in the products you are building! Be patience, however, as it may take a while to mature the entire process! Yet, once you get it on track you will have a fast and controlled way of moving your developments to production and making them live!
We hope this article serves you well! As always, rely on Stellaxius experts to answer your doubts or write about a specific IT, CRM, or Salesforce theme! We’re pleased to share with you our knowledge and expertise! Subscribe to our Knowledge Center blog and make sure you don’t miss our posts! 🙂
SUBSCRIBE KNOWLEDGE CENTER
Subscribe for free to Knowledge Center's monthly digest to receive the hottest news and newest posts directly on your Inbox.