<<

Whitepaper Continuous Integration in Salesforce Development By: Diptiman Prusty 1. Introduction In current SFDC , it pays to be quick to market and be able to focus on the business requirements rather than the development process details. 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 (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.

Page - 2 2. Agile Software Development 3. CI and CD In Salesforce Business enterprises today face several Continuous Integration (CI) and challenges starting from highly competitive Continuous Deployment (CD) are environment, rapidly changing business development practice that requires scenarios and the need to scale up. developers to commit code into a common To overcome the shortcomings of lengthy software source every time they have working code. development cycle, enterprises today have embraced Each commit known as a check-in gets verified by an the AGILE methodology for software development. automated build process. This allows the problems to be identified early in the development process. By integrating regularly, the team can detect errors quickly, Task Board Burndown To In Done and take necessary remedial action. In fact in recent Chart Do Progress years it has come to encompass the whole cycle from

Product code check-in till the production deployment. Daily Backlog Scrum

Sprint The following are some of the key principles behind Review Sprint & Retro Continuous Integration (and Deployment): Planning Sprint Sprint Backlog Automation of build and deployment activities

Working Software Automated Testing ( recommended)

A single source code repository

Product Scrum Team Build validation in an integration environment Owner Master Member Testing in a replica of production system Figure - 1: Agile Diagram Transparency and visibility of the development process Since the AGILE process involves short sprints of smooth running development process, it is very important that the team is enabled to work effectively 4 Test d T and efficiently without breaking each other’s code. This e es Fail or Succeed e t cc u Source Control Server S r o l i a becomes is even more when development teams are F 3 geographically distributed across the globe. 5 Build d il This is where practices like Continuous Integration Bu Continuous Integration Server (CI) and Continuous Delivery (CD) have been able to 2 Fetch Changes help development teams achieve greater efficiency, 6 Notify Success or Failure Check in Changes 1 enabling them to provide rapid software changes while maintaining system stability and security. Manager Developer 1 Developer 2

Figure – 2: Continuous Integration and Deployment process

Page - 3 The key software and tools in this entire process is 4.1 Challenges the CI Server, the source code repository and the automation testing tool. The following were the main challenges that were If we apply the same principles and tools to Salesforce faced by development team: development, it would mean a deployment to either Release cycles were too long due to manual a Sandbox or a production ORG. We can push both deployments across different ORGs configurations as well as customization changes to Deployments were error prone when doing the different ORGs using CI. 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 Source Control DE

CI Tool 4.2 Solution

The JKT team proposed and implemented a Continuous Sandbox Fail Integration and Deployment solution for them that Noti cations helped them achieve greater coordination among teams, as well as AGILE and faster way to push changes to the production system.

Figure 3 - Continuous Integration process for Salesforce development 4.3 Tools 4. CI Success Story – A The following were the tools that were used for achieving this goal: Manufacturing Client In North BitBucket repository America A GIT based code repository tool that can be accessed over internet The client is a leading global manufacturer and distributor of high quality shower Atlassian JIRA and Confluence JIRA is an AGILE project tracking tool while doors, tub doors, shower enclosures and Confluence is a team sharing tool acrylic shower bases. BitBucket Pipelines( Atlassian Bamboo earlier) The company is very well known for off-the-shelf and A cloud and Docker based continuous build and custom shower door solutions with sleek modern style deployment tool for BitBucket repository and impressive value. JK Technosoft have been partnering with them since Force.com migration tool ANT based build and migration tool for Salesforce 2015. JKT’s Salesforce team was working with them on development the Salesforce application development. Releases were planned every 2 months. Eclipse Open source IDE used for development

Page - 4 The team first setup a Salesforce code repository steps. The pipelines are configured using a single with multiple branches on BitBucket and then used configuration file named (bitbucket-pipelines.yml). This that code to setup the build and deployment scripts. file contains the steps to be executed when any code is It was decided to use the Force.com migration tool checked into the repository. which is a Java/Ant based build tool used in Salesforce It is possible to have separate execution steps for deployments. The build and deployment scripts were separate branches. It also supports setting up manual written to ensure code can be pulled from or deployed pipelines that can be triggered when needed. Once the to any environment using configurable parameters. build and deployment are completed/failed an email For the integration deployments a new Sandbox was notification goes to the specified members. 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 Dev1 configured Atlassian JIRA to track the requirements/ Push Commit Update Tickets Dev2 issues and Atlassian Confluence to track the required BitBucket Jira documents and files; these were linked together as well Dev3 Fetch Changes as with BitBucket code check-ins.

Build Pass/Fail Update Tickets

E-mail Noti cation

4.4 WHY Bit-Bucket Pipelines BitBucket Pipeline

Automated Automated When deciding on the CI tool that we are Build Deployment going to use there were several options like Deployment , Hudson etc.

Sandbox Production But the team decided to use BitBucket pipelines due to several reasons: It is tightly coupled with BitBucket since both are from same vendor. Figure – 3: CI using Bit Bucket and Pipeline

It is completely cloud and browser based and hence doesn’t require any dedicated server 5. The Benefits The configuration and setup is simple Following were the achieved benefits of using Continuous Integration process and tools: Simple and quick integrations with increased 4.5 Execution visibility enabling greater communication Once the tool was decided, the team Issues are noticed early and fixed before they could setup the BitBucket pipelines which become major problems would trigger the build and subsequent Spend less time and more time adding deployment scripts automatically when features any code is checked into repository. Build a solid foundation of good quality code

Internally the BitBucket pipelines tool uses Docker Stop waiting to find out if your code’s going to containers to execute the build and deployment work

Page - 5 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 - 6 A HIGH IQ Company Excelling in Innovation and Quality, Consistently

About 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.

United States United Kingdom Bangladesh

New York Berkshire Dhaka Proserve Consulting Inc. JK Technosoft (UK) Ltd. JK Technosoft Ltd. 608, Fifth Avenue, Suite 401, Atrium Court, 100 The Ring, 98 Block-C Road 11 New York, NY 10020 USA Bracknell, Berkshire, RG12 1BW, Banani Model Town Tel: +1 212 265 1626 United Kingdom Dhaka-1213 Fax: +1 212 586 4067 Tel : +44 (0) 1344 393032

India

New Delhi Noida Bangalore Kolkata JK Technosoft Ltd. JK Technosoft Ltd. JK Technosoft Ltd. JK Technosoft Ltd. A-2, Shopping Complex, F-2 & F-3, Sector-3 GGR Tower 1st Floor Sy # 18/2b, Asyst Park Masjid Moth, G.K. II, Noida – 201301, INDIA Ambalipura Road, 1st Floor, GN 37/1 New Delhi – 110048 Tel: +91 120 4606200, 4606300, Ambalipura Village Sarjapur Road, Sector 5, Salt Lake Tel: +91 11 29222864-65 4084500, 2539133 Bangalore – 560 103 Kolkata – 700091 Fax: +91 11 29228048 Fax: +91 120 2539132 Tel: +91 080- 30598300

Pune JK Technosoft Ltd. 804, East court, Phoenix Market City, Viman Nagar, Pune -411 014, Maharashtra, India

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.

Page - 7