Automation with Salesforce DX & CircleCI

The biggest advantage a startup has over established companies is speed.

Wes
SalesTrip
2 min readOct 26, 2018

--

Being quicker than the next company is not enough on its own but is essential if your startup is to survive. It’s also pretty important not to run out of money, so no matter how well funded you should always be optimising your operations.

One way to be efficient and fast is to automate, and CI/CD is one essential cog in the automation wheelhouse. Now, companies have been using CI and CD for a long time and so you might not think there’s much to be gained from YASFCIBP (yet another Salesforce CI blog post) — hopefully, I have something new to add.

Why do the boring things manually when you can get a robot to do them for you?

One application in the SalesTrip landscape is a Salesforce Managed Package. Early on James (our head of Salesforce Architecture) scoured the lands for a CI tool that worked well with SFDX so that we could automate as much as possible, and he settled on CircleCI. Today we have — I think — one of the most advanced CI setups in the Salesforce world, and we wanted to opensource some code to help you do the same. The linked repo contains a CircleCI build file that’ll work out-of-the-box and has example jobs that demonstrate how to:

1. Authenticate with an Org
2. Lint code
3. Create a scratch Org
4. Deploy to an Org
5. Install a managed package
6. Run Apex tests
7. Delete a scratch Org
8. Combining the above into CircleCI workflows

Any feedback is welcome!

--

--

Wes
SalesTrip

Technology Executive, currently CTO @ SalesTrip.