fun with jenkins & salesforce
TRANSCRIPT
![Page 1: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/1.jpg)
Fun with
“Jenkins & Salesforce”
![Page 2: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/2.jpg)
Who I am ?
● Abhinav Gupta● Salesforce MVP & Architect.● In love with Salesforce since
2008.● Founder of Concretio Apps,
ISV and PDO Partner.● t: @abhinavguptas
![Page 3: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/3.jpg)
Agenda
Credits : http://www.jimcarreyonline.com/
![Page 4: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/4.jpg)
Agenda - Real :-)
1. Overview of Jenkins & Force.com Migration Tool.
2. Code versioning practices.3. How could we improve ?4. Automating the same via Jenkins
![Page 5: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/5.jpg)
What is Jenkins
Credits: https://www.cloudbees.com/jenkins/about
![Page 6: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/6.jpg)
Force.com Migration Tool
Credits: https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/
![Page 7: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/7.jpg)
Code Versioning Practices
How mostly devs do
![Page 8: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/8.jpg)
Manual Folder Backups
- Folder is created out of Force.com IDE downloads- Date is added to timestamp along with client name
![Page 9: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/9.jpg)
What’s the problem in it ?
- It sucks :( - Not backed up on server/cloud/hosting- No way for multiple devs to collaborate- No easy way to figure out change log.- It’s depressing and scares me a lot, really :-/
![Page 10: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/10.jpg)
How it could be better ?
● Use Force.com Migration Tool○ It will simplify metadata download○ Mostly one line command, after build.xml setup○ Requires least coding knowledge, mostly a simple
xml editing skill is required.● Use GIT
○ Many git hostings i.e. github, bitbucket etc are available
○ Can work well with Force.com migration tool.
![Page 11: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/11.jpg)
Even Better World ?
● Use Jenkins !○ Its free and open source○ Openshift and other providers offer Free hostings. ○ It can work well with Force.com migration tool○ It works like charm with GIT○ Automate simple nightly code backups.○ Once comfortable, use it like PRO, and do multi
org/sandbox strategy with your clients.
![Page 12: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/12.jpg)
Live Demo
● A Simple nightly code back Job on Jenkins● Auto checkout of required metadata ● Auto commit+push into GIT (bitbucket
private repo)● Hosted for free on https://www.openshift.
com/
![Page 13: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/13.jpg)
Jenkins Job Overview
A simple job for metadata backup in GIT
![Page 14: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/14.jpg)
Jenkins Job Overview
Runs periodically at 3 AM India Time, when even most messed up developer is slept
![Page 15: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/15.jpg)
Masked Passwords PluginPasswords are no more visible after entry, not even in console (ssh could be even better for GIT)Jenkins Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Mask+Passwords+Plugin
![Page 16: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/16.jpg)
Clone Project GIT repo
Clone repo if it’s not already done
![Page 17: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/17.jpg)
Create build.xml on the fly
We don’t want to version build.xml, and want it easy to tweak, thus generate on the flyJenkins Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Text+File+Operations+Plugin
![Page 18: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/18.jpg)
Create package.xml on the flyWe don’t want to version package.xml, and want it easy to tweak, thus generate on the fly(Add more metadata types(triggers, objects, etc) to package.xml, it’s kept simple for quick downloads)Jenkins Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Text+File+Operations+Plugin
![Page 19: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/19.jpg)
Fetch Salesforce metadata
Use Force.com Migration Tool (ANT)to fetch required Salesforce metadata (as per package.xml)
![Page 20: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/20.jpg)
Push into GIT
Push fetched Metadata into GIT. Git ANT tasks could be used here to do the same.
![Page 21: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/21.jpg)
Code reviews Once code is in bitbucket or github online repo, peer/architect code reviews can be conducted on commits. It’s quite easy to point out a single line of code having issue, and describe what is needed (way better than word docs, or excel spreadsheets).
![Page 22: Fun with Jenkins & Salesforce](https://reader033.vdocument.in/reader033/viewer/2022051501/587f02261a28ab35528b72df/html5/thumbnails/22.jpg)
Q & A
Thanks
Abhinav Guptat: @abhinavguptas