Salesforce: CI,CD & CT by "Priyanka Dive" from "Crevise". The presentation was done at #doppa17 DevOps++ Global Summit 2017. All the copyrights are reserved with the author
2. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Who Am I?
- DevOps Engineer at Crevise Technologies
- Passion for technology
- Constant Learner
- Love to read
- Priyanka.Dive@Crevise.com
- Twitter: @Priyanka_Dive
3. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
What is Salesforce?
- Cloud based
- CRM Platform
- Salesforce is the world’s #1 Customer Relationship Management (CRM)
platform. Our cloud-based applications for sales, service, marketing, and
more don’t require IT experts to set up or manage — simply log in and start
connecting to customers in a whole new way.
4. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Sandbox
A sandbox is a copy of a production environment used for a variety of purposes,
commonly including testing and development.
We can have different types of sandbox according our requirements:
- Developer Sandbox
- Developer Pro Sandbox
- Partial Copy Sandbox
- Full Sandbox
5. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Salesforce Development Vs
Other Tech Stack Development
- Salesforce development is different
- Virtual environment is in the form of sandbox.
- You can’t run it locally
- Everything is on cloud
- There is no version control in salesforce sandbox environments.
- Large projects with shared environment is real mess without versioning
- No copy code and deployment done process
6. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Traditional way of deployment
1. Using changeset
- Good for small deployments
- Not preferred for Large Deployments
2. Ant Migration tool
- Large Deployments can be done
- Easy reverting deployments
7. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Problem with Traditional way
- No versioning
- Can be a big mess when multiple developers are working on project and not
in sync
- Simple change can look like “a needle in a haystack”
8. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Case Study
Bajaj Finserv uses salesforce platform for some of their projects.
Challenges:
- Working with large team of developers with salesforce
- managing large deployments with changeset is hard.
- Keeping track of all changes
- Achieving continuous testing
Why not devops for salesforce?
9. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Our Solution
10. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Tools Used
- Git : Tracking salesforce changes in Git
- Force.com Migration tool : for salesforce deployments
- Jenkins :Automate deployments to Pre-UAT environment with Jenkins & Ant
script
- Qualitia : Scriptless testing Tool
11. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Using Gitlab for versioning salesforce
- Force.com Works well with Git
- Every change in sandbox can be tracked in gitlab
- Developers only need to change package.xml for changes they need to test
on Pre-UAT sandbox.
- We can maintain different branches according to scenario
- Able to compare code on git Branch with Sandbox
- Can track those changes which are not present in git
12. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Jenkins to Automate salesforce
deployment & Backups
- Jenkins can be integrated with Gitlab
- Jenkins is able to execute ant scripts for Force.com Migration tool.
- Also, Jenkins integrate with Gitlab to show status of Job in Pipeline with
respect to each commit & push
- Jenkins job for metadata backup to Git
- Jenkins job to deploy from git to sandbox by comparing git and sandbox
13. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Development with Gitlab
- Use Eclipse with Force.com IDE and Git Plugin
- Copy code and metadata from Sandbox to Eclipse using Force.com IDE
- Create Project on Git
- Configure Git in Eclipse , commit and push code from Eclipse to Git.
- Trigger Jenkins Job for deployment
1. Pull Source code from Git Branch
2. Invoke Ant script
14. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Deployment using Jenkins
15. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Sample Build.xml for
Retrieve Job
Build.xml for Retrieve Job
<!-- Retrieve the contents into another directory -->
<sf:retrieve
username="${sf.username}"
password="${sf.password}${sf.token}"
serverurl="${sf.serverurl}"
retrieveTarget="src"
unpackaged="${basedir}/package.xml"
/>
</target>
16. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Sample Build.xml & Package.xml
for Deploy Job
Build.xml for Deploy Job
<target name="deployCode">
<!-- Deploy Code From src to SandBox --
>
<sf:deploy
username="${sf.username}"
password="${sf.password}${sf.token}"
serverurl="${sf.serverurl}"
deployroot="src"
runAllTests="false"
/>
</target>
Package.xml For Deploy Job
<?xml version="1.0" encoding="UTF-
8"?>
<Package
xmlns="http://soap.sforce.com/2006
/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<version>36.0</version>
</Package>
17. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Continuous Testing with Qualitia
- Achieve scriptless testing with Qualitia
- Qualitia is a functional test automation platform which provides us way to
automate testing without Scripting
- Qualitia integrates with jenkins
- Run test cases on sandbox and present Result in HTML
- Schedule your automated test executions using Jenkins
18. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Recap (Our Solution)
19. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Running Test cases with Qualitia
- Trigger jenkins job after Git push to run test cases
- We need following :
1. Windows slave to jenkins server with java
2. Qualitia tool jar
3.Provide xml Path , Log Path ,Chromedriver executable
20. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Conclusion
- We can have versioning in salesforce
- With Agile Testing we can find Bugs in Early stage
- We don’t need expertise to Set up
- Achieving CI CD in salesforce become easy.
21. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
Questions?
- Priyanka.Dive@Crevise.com
- Twitter @Priyanka_Dive
22. #DOPPA17
As the author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing
alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels - (Provided due
credit is given to me/us)
References
https://www.salesforce.com/products/what-is-salesforce/
https://www.qualitiasoft.com/
https://developer.salesforce.com/page/Force.com_Migration_Tool
http://www.indidesign.in/wp-content/uploads/2013/11/finserv.jpg