SlideShare a Scribd company logo
Setting Up CircleCI Workflows
for Your Salesforce Apps
Daniel Stange
Technical Architect
DIA die.interaktiven GmbH & Co. KG
Frankfurt, Germany User Group Leader
You can find me at:
Twitter: @stangomat
Blog: blog.danielstange.de
Agenda
• Prerequisites
• Why CI?
• Basics & Concepts
• Design our workflow
• Run our workflow
• Add some QA measures
• Where to head next?
Sample Project
Find the repo at
github.com/dstdia/CircleCI-Webinar
1
PREREQUISITES
PREREQUISITES
What do you need to start?
• Salesforce DX Developer Hub
(your Prod or a trial dev hub org)
• A distributed version control system.
Github or Bitbucket are great
• The Salesforce CLI (basically: download and install the Salesforce DX package
on your computer)
FIRST STEPS
• Checkout my repo from
http://bit.ly/SFDX_CircleCI
• Sign up for a CircleCI trial:
https://circleci.com/
(single sign-on with Github or Bitbucket)
2
WHY CI
WHY CI?
Extra effort - to save time and effort
• Structured Change Process:
Repeatable, automated, transparent
• Find bugs and flaws
• Deploy more often and earlier
• Reduce the effort to collect and deploy changes
• Reduce deployment failures
• Promote agile / iterative approach
• Introduce QA steps
WHY PUT THE EFFORT
IN A CI WORKFLOW?
Test
Automation
Deployment
Automation
Development
Lifecycle
Increase
Quality
More and better testing
less failing deployment
WHY SFDX and Circle CI?
• SFDX is the new default toolchain to manage Salesforce customizations
• Circle CI integrates seamlessly by SSO with Bitbucket or Github…
• the entry tier is free… and for open source, you’ll get a powerful set of containers
for parallel builds
• (relatively) easy to configure
• Building workflows for building cloud software by using cloud software
is not just recursive…
• … but a great approach to tie in the exact tool at the exact moment
you need it (e.g. static code analysis with Apex PMD or Clayton.io)
DEMO
3
BASICS &
CONCEPTS
SFDX ORCHESTRATION
sfdx force:org:create
sfdx force:source:push
sfdx force:apex:test:run
sfdx force:source:convert
sfdx force:mdapi:deploy
• Create an org
• Install your source
• Run tests
• Convert to Metadata format
• Deploy to target
CI ORCHESTRATION
WORKFLOW
JOB(S)
STEPS
CI ORCHESTRATION
WORKFLOW
JOB(S)
STEPS
STEPS
JOB(S)
STEPS
STEPS
DEMO
4
LET‘S START
BUILDING
Building our flow
PLANNING
• What should happen? When and why?
• Which environments do you need? When and why?
• Understand the structure of the CircleCI config and map your plan to
config items
Building our flow
STEPS
• Test in isolation
• Verify the code quality
• If both finish successfully, and if we had (merge) commit to the master
branch, deploy to our target org
Building our flow
STEPS
• Install the Salesforce CLI
• Connect to our dev hub
• Create a scratch org, push and test
• Install and run PMD
• Connect to our target and deploy if we are in the master branch
Building our flow
STEPS
tests pmd-check deploy
Prepare Salesforce DX Prepare Salesforce DX Prepare Salesforce DX
Create Org Prepare Apex PMD
Push Code Convert Source Convert Source
Run Project Tests Run Apex PMD Deploy with Local Tests
Building our flow
STEPS
tests pmd-check Deploy (master branch)
Prepare Salesforce DX
Create Org Prepare Apex PMD
Push Code Convert Source Convert Source
Run Project Tests Run Apex PMD Deploy with Local Tests
Building our flow
The DX setup job
• Download and install Salesforce DX
• Authenticate your Org
• Create and Persist a Workspace
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce Apps
• Jobs run in independent containers. You have to persist what you want
to use later…
• Workspaces act as your “drive” for a build to store data. You can persist
and attach them
• You’ll have to export paths to your containers later
• Caches can live longer than a single build
• Artifacts and Test Results are can persist data from the build to access
them from the CircleCI UI
PERSISTENCE
Building our flow
The Test Execution job
• Create a new scratch org
• Checkout source
• Push Source to test org
• Execute the Apex Unit Tests
• Persist the Results
• Can you add Lightning Testing Service on your own?
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce Apps
Building our flow
The Deployment job
Finally, we’ll deploy our source into a persistent environment
• Sandboxes for integration tests or UAT
• Productive System for final deployment
• Convert Source to Metadata API format
• Deploy Metadata and run specific tests or suites (not only the project’s
own tests…)
Setting Up CircleCI Workflows for Your Salesforce Apps
Bringing it all together – the Workflow Section
Use filters and
requires to control
➜ order
➜ parallelism
➜ conditions
of the workflow
execution
DONE!
• Make a change and commit to your repo…
• But don’t push yet…!
5
RUNNING
OUR FLOW
Running our flow
o Let’s push your commit to origin
o Extra: Make any other change you like.
o Review your CircleCI workflow – did it complete?
6
ADDING A
QUALITY
GATE
DEMO
Static code analysis as
QUALITY GATE
• Static code analysis checks your code/metadata against pre -defined
rules
• I’ll embed Apex PMD to showcase a free, community maintained product,
but you can add services like Clayton.io as well
• Violations appear as errors and can be used to block merges
Quality Gates: STEPS
• Download PMD
• Scan for Violations by using the standard ruleset
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce Apps
Quality Gate
LET’S TRY IT OUT
• Let’s violate an Apex PMD rule
• add DML in a loop
• Or an empty method
• Or a badly named method (like Badly_namedMethod() )
• Commit & push
• Check what happens to our build
7
NEXT STEPS
NEXT STEPS
• Break down monolythic metadata of your project
• use 2nd generation packages to have smaller installable bundles
See an excellent example here:
https://github.com/trailheadapps/easy-spaces
• Parallelize test jobs to save time. See a smart approach here:
https://github.com/Szandor72/dreamole18-ci-in-30-minutes
Sample Project
Find the repo at
github.com/dstdia/CircleCI-Webinar
THANK Y U!
Connect with me
Twitter: @stangomat
Email: Daniel.stange@die-interaktiven.de
die.interaktiven GmbH & Co. KG
Am Leitz-Park 4 · D-35578 Wetzlar
Phone
Fax
info@die-interaktiven.de
www.die-interaktiven.de
+49 6441 38457-0
+49 6441 38457-90

More Related Content

What's hot (20)

PPTX
Kubernetes Networking 101
Weaveworks
 
PPTX
Dockers and containers basics
Sourabh Saxena
 
PDF
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Edureka!
 
PDF
Huawei Switch How To - Configuring a basic DHCP server
IPMAX s.r.l.
 
PDF
Monitoring kubernetes with prometheus
Brice Fernandes
 
ODP
pfSense presentation
Simon Vass
 
PPTX
Docker Introduction
Hao Fan
 
PDF
Kubernetes Architecture and Introduction
Stefan Schimanski
 
PDF
OpenNebula 4.14 Hands-on Tutorial
OpenNebula Project
 
PPTX
Azure DevOps
Allied Consultants
 
PDF
Guest Access with ArubaOS
Aruba, a Hewlett Packard Enterprise company
 
PPTX
Introduction to docker
Frederik Mogensen
 
DOCX
Ansible
David Adorons-Dieu
 
PDF
An Introduction to Rancher
Conner Swann
 
PDF
Alphorm.com Formation Ansible : Le Guide Complet du Débutant
Alphorm
 
PDF
Apache kafka
NexThoughts Technologies
 
PPTX
Packer
Nitesh Saini
 
PDF
LISA2019 Linux Systems Performance
Brendan Gregg
 
PPTX
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
Phil Wilkins
 
PPTX
Introduction to ansible
Omid Vahdaty
 
Kubernetes Networking 101
Weaveworks
 
Dockers and containers basics
Sourabh Saxena
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Edureka!
 
Huawei Switch How To - Configuring a basic DHCP server
IPMAX s.r.l.
 
Monitoring kubernetes with prometheus
Brice Fernandes
 
pfSense presentation
Simon Vass
 
Docker Introduction
Hao Fan
 
Kubernetes Architecture and Introduction
Stefan Schimanski
 
OpenNebula 4.14 Hands-on Tutorial
OpenNebula Project
 
Azure DevOps
Allied Consultants
 
Introduction to docker
Frederik Mogensen
 
An Introduction to Rancher
Conner Swann
 
Alphorm.com Formation Ansible : Le Guide Complet du Débutant
Alphorm
 
Packer
Nitesh Saini
 
LISA2019 Linux Systems Performance
Brendan Gregg
 
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
Phil Wilkins
 
Introduction to ansible
Omid Vahdaty
 

Similar to Setting Up CircleCI Workflows for Your Salesforce Apps (20)

PDF
Continuous Deployment To The Cloud @DevoxxPL 2017
Marcin Grzejszczak
 
PDF
APEX Application Lifecycle and Deployment 20220714.pdf
Richard Martens
 
PDF
Getting to Walk with DevOps
Eklove Mohan
 
PPTX
Acing application lifecycle management in SharePoint
Jeremy Thake
 
PPTX
7 steps to simplifying your AI workflows
Wisecube AI
 
PDF
I am afraid of no test! The power of BDD
Ortus Solutions, Corp
 
PDF
Sitecore development approach evolution – destination helix
Peter Nazarov
 
PPTX
How (and why) to roll your own Docker SaaS
Ryan Crawford
 
PPTX
Bringing DevOps to the Database
Michaela Murray
 
PPTX
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Abhinav Gupta
 
PPTX
Azure DevOps Tasks.pptx
PrasanthOneness
 
PPTX
The ABC's of IaC
Steven Pressman, CISSP
 
PDF
Continuous Delivery: How RightScale Releases Weekly
RightScale
 
PPTX
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
PPTX
Continuous Deployment to the cloud
VMware Tanzu
 
PDF
Continuous Deployment of your Application @SpringOne
ciberkleid
 
PDF
Continuous Deployment of your Application - SpringOne Tour Dallas
VMware Tanzu
 
PPTX
Lean-Agile Development with SharePoint - Bill Ayers
SPC Adriatics
 
PPT
Database continuous integration, unit test and functional test
Harry Zheng
 
PDF
Continuous delivery @wcap 5-09-2013
David Funaro
 
Continuous Deployment To The Cloud @DevoxxPL 2017
Marcin Grzejszczak
 
APEX Application Lifecycle and Deployment 20220714.pdf
Richard Martens
 
Getting to Walk with DevOps
Eklove Mohan
 
Acing application lifecycle management in SharePoint
Jeremy Thake
 
7 steps to simplifying your AI workflows
Wisecube AI
 
I am afraid of no test! The power of BDD
Ortus Solutions, Corp
 
Sitecore development approach evolution – destination helix
Peter Nazarov
 
How (and why) to roll your own Docker SaaS
Ryan Crawford
 
Bringing DevOps to the Database
Michaela Murray
 
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Abhinav Gupta
 
Azure DevOps Tasks.pptx
PrasanthOneness
 
The ABC's of IaC
Steven Pressman, CISSP
 
Continuous Delivery: How RightScale Releases Weekly
RightScale
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
Continuous Deployment to the cloud
VMware Tanzu
 
Continuous Deployment of your Application @SpringOne
ciberkleid
 
Continuous Deployment of your Application - SpringOne Tour Dallas
VMware Tanzu
 
Lean-Agile Development with SharePoint - Bill Ayers
SPC Adriatics
 
Database continuous integration, unit test and functional test
Harry Zheng
 
Continuous delivery @wcap 5-09-2013
David Funaro
 
Ad

More from Daniel Stange (7)

PDF
Force Academy '19: I fell in love with clicks AND code - here's what I learne...
Daniel Stange
 
PDF
YeurDreamin' - Put the Wow! into your Flow with Lightning Experience
Daniel Stange
 
PPTX
Route your triggers like a pro #DF18
Daniel Stange
 
PPTX
Your admin toolbelt is not complete without Salesforce DX
Daniel Stange
 
PPTX
Gear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Daniel Stange
 
PPTX
Tahoe Dreamin 2018: It simply works... until it breaks!
Daniel Stange
 
PPTX
IT SIMPLY WORKS! … UNTIL IT BREAKS. STANDARDS, BEST PRACTICE AND ENTERPRISE P...
Daniel Stange
 
Force Academy '19: I fell in love with clicks AND code - here's what I learne...
Daniel Stange
 
YeurDreamin' - Put the Wow! into your Flow with Lightning Experience
Daniel Stange
 
Route your triggers like a pro #DF18
Daniel Stange
 
Your admin toolbelt is not complete without Salesforce DX
Daniel Stange
 
Gear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Daniel Stange
 
Tahoe Dreamin 2018: It simply works... until it breaks!
Daniel Stange
 
IT SIMPLY WORKS! … UNTIL IT BREAKS. STANDARDS, BEST PRACTICE AND ENTERPRISE P...
Daniel Stange
 
Ad

Recently uploaded (20)

PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 

Setting Up CircleCI Workflows for Your Salesforce Apps

  • 1. Setting Up CircleCI Workflows for Your Salesforce Apps
  • 2. Daniel Stange Technical Architect DIA die.interaktiven GmbH & Co. KG Frankfurt, Germany User Group Leader You can find me at: Twitter: @stangomat Blog: blog.danielstange.de
  • 3. Agenda • Prerequisites • Why CI? • Basics & Concepts • Design our workflow • Run our workflow • Add some QA measures • Where to head next?
  • 4. Sample Project Find the repo at github.com/dstdia/CircleCI-Webinar
  • 6. PREREQUISITES What do you need to start? • Salesforce DX Developer Hub (your Prod or a trial dev hub org) • A distributed version control system. Github or Bitbucket are great • The Salesforce CLI (basically: download and install the Salesforce DX package on your computer)
  • 7. FIRST STEPS • Checkout my repo from http://bit.ly/SFDX_CircleCI • Sign up for a CircleCI trial: https://circleci.com/ (single sign-on with Github or Bitbucket)
  • 9. WHY CI? Extra effort - to save time and effort • Structured Change Process: Repeatable, automated, transparent • Find bugs and flaws • Deploy more often and earlier • Reduce the effort to collect and deploy changes • Reduce deployment failures • Promote agile / iterative approach • Introduce QA steps
  • 10. WHY PUT THE EFFORT IN A CI WORKFLOW? Test Automation Deployment Automation Development Lifecycle
  • 11. Increase Quality More and better testing less failing deployment
  • 12. WHY SFDX and Circle CI? • SFDX is the new default toolchain to manage Salesforce customizations • Circle CI integrates seamlessly by SSO with Bitbucket or Github… • the entry tier is free… and for open source, you’ll get a powerful set of containers for parallel builds • (relatively) easy to configure • Building workflows for building cloud software by using cloud software is not just recursive… • … but a great approach to tie in the exact tool at the exact moment you need it (e.g. static code analysis with Apex PMD or Clayton.io)
  • 13. DEMO
  • 15. SFDX ORCHESTRATION sfdx force:org:create sfdx force:source:push sfdx force:apex:test:run sfdx force:source:convert sfdx force:mdapi:deploy • Create an org • Install your source • Run tests • Convert to Metadata format • Deploy to target
  • 18. DEMO
  • 20. Building our flow PLANNING • What should happen? When and why? • Which environments do you need? When and why? • Understand the structure of the CircleCI config and map your plan to config items
  • 21. Building our flow STEPS • Test in isolation • Verify the code quality • If both finish successfully, and if we had (merge) commit to the master branch, deploy to our target org
  • 22. Building our flow STEPS • Install the Salesforce CLI • Connect to our dev hub • Create a scratch org, push and test • Install and run PMD • Connect to our target and deploy if we are in the master branch
  • 23. Building our flow STEPS tests pmd-check deploy Prepare Salesforce DX Prepare Salesforce DX Prepare Salesforce DX Create Org Prepare Apex PMD Push Code Convert Source Convert Source Run Project Tests Run Apex PMD Deploy with Local Tests
  • 24. Building our flow STEPS tests pmd-check Deploy (master branch) Prepare Salesforce DX Create Org Prepare Apex PMD Push Code Convert Source Convert Source Run Project Tests Run Apex PMD Deploy with Local Tests
  • 25. Building our flow The DX setup job • Download and install Salesforce DX • Authenticate your Org • Create and Persist a Workspace
  • 28. • Jobs run in independent containers. You have to persist what you want to use later… • Workspaces act as your “drive” for a build to store data. You can persist and attach them • You’ll have to export paths to your containers later • Caches can live longer than a single build • Artifacts and Test Results are can persist data from the build to access them from the CircleCI UI PERSISTENCE
  • 29. Building our flow The Test Execution job • Create a new scratch org • Checkout source • Push Source to test org • Execute the Apex Unit Tests • Persist the Results • Can you add Lightning Testing Service on your own?
  • 32. Building our flow The Deployment job Finally, we’ll deploy our source into a persistent environment • Sandboxes for integration tests or UAT • Productive System for final deployment • Convert Source to Metadata API format • Deploy Metadata and run specific tests or suites (not only the project’s own tests…)
  • 34. Bringing it all together – the Workflow Section Use filters and requires to control ➜ order ➜ parallelism ➜ conditions of the workflow execution
  • 35. DONE! • Make a change and commit to your repo… • But don’t push yet…!
  • 37. Running our flow o Let’s push your commit to origin o Extra: Make any other change you like. o Review your CircleCI workflow – did it complete?
  • 39. DEMO
  • 40. Static code analysis as QUALITY GATE • Static code analysis checks your code/metadata against pre -defined rules • I’ll embed Apex PMD to showcase a free, community maintained product, but you can add services like Clayton.io as well • Violations appear as errors and can be used to block merges
  • 41. Quality Gates: STEPS • Download PMD • Scan for Violations by using the standard ruleset
  • 44. Quality Gate LET’S TRY IT OUT • Let’s violate an Apex PMD rule • add DML in a loop • Or an empty method • Or a badly named method (like Badly_namedMethod() ) • Commit & push • Check what happens to our build
  • 46. NEXT STEPS • Break down monolythic metadata of your project • use 2nd generation packages to have smaller installable bundles See an excellent example here: https://github.com/trailheadapps/easy-spaces • Parallelize test jobs to save time. See a smart approach here: https://github.com/Szandor72/dreamole18-ci-in-30-minutes
  • 47. Sample Project Find the repo at github.com/dstdia/CircleCI-Webinar
  • 48. THANK Y U! Connect with me Twitter: @stangomat Email: [email protected]
  • 49. die.interaktiven GmbH & Co. KG Am Leitz-Park 4 · D-35578 Wetzlar Phone Fax [email protected] www.die-interaktiven.de +49 6441 38457-0 +49 6441 38457-90