Continuous Integration in Salesforce Development
Whitepaper
By: Diptiman Prusty
Page - 2
1. Introduction
DevOps culture for software development has gained rapid momentum in SFDC development industry in the last few years. It involves adopting agile software development methodologies like Continuous Deployment, Continuous Integration (CI) and Continuous Delivery (CD). This enables them to resolve issues quicker, get instant feedback on new products and features, improve the quality of software and ultimately save cost and gain market share.As we shall see below, Salesforce platform is very well suited to use the Continuous Integration and Continuous Delivery methodology to enable organizations to be agile.
In current SFDC software development scenario, it pays to be quick to market and be able to focus on the business requirements rather than the development process details.
Page - 3
Notify Success or Failure 16
2
Check in Changes
Fetch Changes
Build
TestFail or Succeed
Manager Developer 1 Developer 2
Continuous Integration ServerBuild
Test
Fail o
r Succ
eed
3
4
5
Source Control Server
Figure – 2: Continuous Integration and Deployment process
2. Agile Software Development
To overcome the shortcomings of lengthy software development cycle, enterprises today have embraced the AGILE methodology for software development.
Since the AGILE process involves short sprints of smooth running development process, it is very important that the team is enabled to work effectively and efficiently without breaking each other’s code. This becomes is even more when development teams are geographically distributed across the globe.This is where practices like Continuous Integration (CI) and Continuous Delivery (CD) have been able to help development teams achieve greater efficiency, enabling them to provide rapid software changes while maintaining system stability and security.
Business enterprises today face several challenges starting from highly competitive environment, rapidly changing business scenarios and the need to scale up.
The following are some of the key principles behind
Continuous Integration (and Deployment):
Automation of build and deployment activities
Automated Testing ( recommended)
A single source code repository
Build validation in an integration environment
Testing in a replica of production systemTransparency and visibility of the development process
3. CI and CD In Salesforce
Each commit known as a check-in gets verified by an automated build process. This allows the problems to be identified early in the development process. By integrating regularly, the team can detect errors quickly, and take necessary remedial action. In fact in recent years it has come to encompass the whole cycle from code check-in till the production deployment.
Continuous Integration (CI) and Continuous Deployment (CD) are development practice that requires developers to commit code into a common source every time they have working code.
ProductBacklog
ProductOwner
BurndownChart
Task Board
SprintPlanning
SprintBacklog
Sprint
SprintReview& Retro
DailyScrum
ToDo
InProgress
Done
WorkingSoftware
ScrumMaster
TeamMember
Figure - 1: Agile Diagram
Page - 4
4.3 ToolsThe following were the tools that were used for
achieving this goal:
BitBucket repositoryA GIT based code repository tool that can be accessed over internet
Atlassian JIRA and ConfluenceJIRA is an AGILE project tracking tool while Confluence is a team sharing tool
BitBucket Pipelines( Atlassian Bamboo earlier)A cloud and Docker based continuous build and deployment tool for BitBucket repository
Force.com migration toolANT based build and migration tool for Salesforce development
EclipseOpen source IDE used for development
4. CI Success Story – A Manufacturing Client In North America
4.1 Challenges
4.2 Solution
The company is very well known for off-the-shelf and custom shower door solutions with sleek modern style and impressive value.JK Technosoft have been partnering with them since 2015. JKT’s Salesforce team was working with them on the Salesforce application development. Releases were planned every 2 months.
The JKT team proposed and implemented a Continuous Integration and Deployment solution for them that helped them achieve greater coordination among teams, as well as AGILE and faster way to push changes to the production system.
The client is a leading global manufacturer and distributor of high quality shower doors, tub doors, shower enclosures and acrylic shower bases.
The following were the main challenges that were
faced by development team:
Release cycles were too long due to manual deployments across different ORGs
Deployments were error prone when doing the changes manually
Since multiple developers were working on the code, there was a risk of code overwrite
Code versioning was an issue if team wanted to revert back to earlier version
The key software and tools in this entire process is the CI Server, the source code repository and the automation testing tool. If we apply the same principles and tools to Salesforce development, it would mean a deployment to either a Sandbox or a production ORG. We can push both configurations as well as customization changes to different ORGs using CI.
Development Testing
DE
SourceControl
Sandbox
CI Tool
FailNoti�cations
Figure 3 - Continuous Integration process for Salesforce development
Page - 5
Following were the achieved benefits of using
Continuous Integration process and tools:
Simple and quick integrations with increased visibility enabling greater communication
Issues are noticed early and fixed before they could become major problems
Spend less time debugging and more time adding features
Build a solid foundation of good quality code
Stop waiting to find out if your code’s going to work
5. The Benefits
Internally the BitBucket pipelines tool uses Docker containers to execute the build and deployment
But the team decided to use BitBucket pipelines due to
several reasons:
It is tightly coupled with BitBucket since both are from same vendor.
It is completely cloud and browser based and hence doesn’t require any dedicated server
The configuration and setup is simple
4.4 WHY Bit-Bucket PipelinesWhen deciding on the CI tool that we are going to use there were several options like Jenkins, Hudson etc.
4.5 ExecutionOnce the tool was decided, the team setup the BitBucket pipelines which would trigger the build and subsequent deployment scripts automatically when any code is checked into repository.
Dev1
Dev2
Dev3
Push Commit Update Tickets
Build Pass/Fail
E-mail Noti�cationBitBucket Pipeline
Sandbox Production
AutomatedBuild
AutomatedDeployment
Update Tickets
Fetch Changes
BitBucket Jira
Deployment
The team first setup a Salesforce code repository with multiple branches on BitBucket and then used that code to setup the build and deployment scripts. It was decided to use the Force.com migration tool which is a Java/Ant based build tool used in Salesforce deployments. The build and deployment scripts were written to ensure code can be pulled from or deployed to any environment using configurable parameters.For the integration deployments a new Sandbox was created to which all development code gets deployed once it is checked in. Once the testing was completed on integration Sandbox, code was merged into the UAT/master branch in BitBucket. The development team also configured Atlassian JIRA to track the requirements/issues and Atlassian Confluence to track the required documents and files; these were linked together as well as with BitBucket code check-ins.
steps. The pipelines are configured using a single configuration file named (bitbucket-pipelines.yml). This file contains the steps to be executed when any code is checked into the repository. It is possible to have separate execution steps for separate branches. It also supports setting up manual pipelines that can be triggered when needed. Once the build and deployment are completed/failed an email notification goes to the specified members.
Figure – 3: CI using Bit Bucket and Pipeline
Page - 6
Deliver quality software more rapidly
Within a brief time, the business team started seeing the benefits of the process. The team could move fully into Agile based development with shorter sprints and hence push business functionality more frequently to users. The future plan is to have automated testing done after every integration build as well as having a refined multi branch development rollouts.
Page - 7
A HIGH IQ CompanyExcelling in Innovation and Quality, Consistently
India
New DelhiJK Technosoft Ltd.A-2, Shopping Complex, Masjid Moth, G.K. II,New Delhi – 110048Tel: +91 11 29222864-65Fax: +91 11 29228048
PuneJK Technosoft Ltd.804, East court,Phoenix Market City,Viman Nagar, Pune -411 014,Maharashtra, India
KolkataJK Technosoft Ltd.Asyst Park1st Floor, GN 37/1Sector 5, Salt LakeKolkata – 700091
BangaloreJK Technosoft Ltd.GGR Tower 1st Floor Sy # 18/2b, Ambalipura Road,Ambalipura Village Sarjapur Road, Bangalore – 560 103Tel: +91 080- 30598300
NoidaJK Technosoft Ltd.F-2 & F-3, Sector-3Noida – 201301, INDIATel: +91 120 4606200, 4606300, 4084500, 2539133Fax: +91 120 2539132
BangladeshUnited States United Kingdom
DhakaJK Technosoft Ltd.98 Block-C Road 11Banani Model Town Dhaka-1213
New YorkProserve Consulting Inc.608, Fifth Avenue, Suite 401,New York, NY 10020 USATel: +1 212 265 1626Fax: +1 212 586 4067
BerkshireJK Technosoft (UK) Ltd.Atrium Court, 100 The Ring,Bracknell, Berkshire, RG12 1BW,United KingdomTel : +44 (0) 1344 393032
Copyright© 2017, JK Technosoft Ltd. All rights reserved. No part of this document may be reproduced or transmitted in any other form or by any means, elec-tronic or otherwise, including photocopying, reprinting or recording, for any purpose, without the written permission of JKT.
JKT - a HIGH IQ Company, is a global software services and solutions company enabling clients to deliver sustainable success by providing value-driven services & solutions. JKT’s strategic technology-backed solutions are designed to equip your business with the competitive edge you require. We specialize in delivering customized solutions that use sustaining and next-generation disruptive technologies to ensure your business stays ahead of the competition.
About JKT
Top Related