SFDX-CLI Paves The Way for Open-Source Salesforce Devops
The case for investment in devops engineering is powerful. Devops is highly impactful because technology products change rapidly through the power of devops engineering. Product evolution based on user feedback lets enterprises compete and succeed with the power of software. Why can’t we do the same thing for the thousands of developers and millions of people who use Salesforce products and services today? Fortunately, Salesforce Devops is now changing for the better with the emerging SFDX-CLI ecosystem.
To help Salesforce developers and architects see the power of devops, I give some tips on basic Salesforce DX automation with BASH and MAKE in this post. Then, I discuss SFDX-CLI and its new plugin ecosystem and how it represents a key touch point between the Salesforce platform and open-source devops engineering. I’ll wrap it up with a list of the SFDX-CLI plugins that are interesting for Salesforce devops engineers.
Scripting to The Core
A devops engineer starts out small and builds up layers of functionality. Let us examine how those layers get built by looking at the heart of devops engineering: scripting.
Linux scripts chain smaller parts of a system into a single command. Chains of small commands gives devops engineers the ability to iterate and compound scripted functions effectively.
One of the ways of the devops is to stick with Ubuntu or Redhat Linux and BASH for development and production scripting platforms. MacOS is close to Linux, but not identical.
VS Code Remote provides for the use of standard scripting platforms by using powerful Linux servers on the local LAN in conjunction with off-the-shelf desktops and laptops. This doubles, at a minimum, the CPU power applied to a developer workstation which improves productivity. Using a standard backend service for developers also decreases onboarding time for new developers. Facebook and Microsoft developed VS Code Remote together to help Facebook’s SDLC process.
SFDX-CLI Scripting Essentials: Bash and make
Devops engineering puts into order the most atomic components of a build process. Engineers start this process by automating functions with short scripts.
Scripts use platform CLIs like GitHub CLI, docker-compose, kubectl, npm, aws, gcloud, and sfdx to deploy code, move artifacts, apply changes, and observe what is happening on the platforms. Small scripts are then used in other scripts. Eventually, the engineer has created layers of functionality built up into a master script, which accomplishes a high-level task with one command. A high-level function could be “take a new change set, run unit tests, run end-to-end-tests, deploy to 3 new sandboxes, send email to everybody about the status, and monitor the results.”
The mark of a good devops engineer is to be a lazy typist who saves keystrokes in their day-to-day existence. That is where GNU MAKE and a good Makefile become favorite tools. Here is a simple Makefile I made for an SFDX project. To use it yourself create a file called
Makefile in the root directory of your project and paste in the contents. Change
project-name to your project name in Line 13. Create a permission set named
ProjectPermSet to support loading any custom objects or fields.
SFDX developers equipped with effective Makefiles are more productive and work at devops speed. For example, if you put this Makefile into your SFDX project root directory, typing “make build” runs Lines 13 to 17 in the Makefile. MAKE is extended by writing BASH scripts that are called by the Makefile.
Scripting common actions with BASH and MAKE helps devops processes become more automatic. Standard MAKE commands which invoke customized build actions can enable the systematic automation of a team of developers.
SFDX-CLI Leads the Devops Way
The SFDX-CLI team at Salesforce leads the way for Salesforce devops engineers. Not only have they delivered an effective CLI-based interface to some Salesforce APIs, but they have also created an ecosystem of SFDX-CLI plugins using the same TypeScript interface.
Several SFDX-CLI plugins are available to assist developers in corporate or ISV settings. I did a quick survey of available plugins to evaluate this new technology ecosystem.
Vern’s List of SFDX-CLI Devops Plugins
I used Google, GitHub and Awesome SFDX Plugins to search for plugins to make my list. I picked the plugins that seemed to be useful for devops scripting. Here is a summary of the project names, authors, and repo links.
Want to be on the list? Email me at [email protected].
The Convergence Is Here With SFDX-CLI
It is hard to understate the importance of SFDX-CLI to the enablement of Salesforce devops. By putting API-level functionality in a BASH script running on Linux, Salesforce has established the needed touch point between Salesforce and open-source devops engineering.
SFDX-CLI as a scripting command is now within the grasp of every devops engineer. This helps engineers manage Salesforce devops without the need to log in and use Salesforce!
Furthermore, with TypeScript CLI authoring and an open-source ecosystem blossoming, the sky’s the limit in terms of enabling Salesforce Devops with small, incremental scripts.
The Salesforce Devops Journey Continues
There is so much more to do to help developers and architects to enable millions of Salesforce users to be happier and more productive. If you have your own devops story or other article ideas, drop me a line today!