How to set up Continuous Integration for Salesforce.com
This beginners tutorial will take you through all the steps you need to perform to set up source control and release management for your Salesforce.com instance with Atlassian Stash and Bamboo.
Up until now, many Salesforce.com partners approach development in a way which means that different versions of code are deployed in different Sandboxes, and changes are made manually between environments using change sets or Eclipse.
Whilst appropriate in certain implementations, this method of managing code often becomes labour intensive when dealing with multiple new features, an expanding code base and changing staff etc. ‘Continuous Integration’ can change all that by creating a central repository for code and automating deployments between environments. It significantly improves the ability to track, remove, merge and deploy changes.
This guide will take you through setting up Source Code and Automated Release Management for Salesforce.com using Atlassian’s Continuous Integration toolset for a sample delivery methodology. This guide does not include any information on Automated Testing.
Continuous Integration Methodology
In this tutorial we will set up a methodology that will work as follows:
- Developers will write/test new features in their own developer org (marked DEV below);
- When ready the developers will commit new features into Source Control (Stash);
- Release management (Bamboo) will automatically build any new features to a CI environment;
- Release management (Bamboo) will be used to manually build to UAT and LIVE.
Here is a diagram that shows this model:
This guide contains all the information and tutorials you need to set this process up, including instructions on how to set up Bamboo and Stash on Amazon Web Services.
This tutorial requires the below pre-requisites both on your machine, and available to you online:
Installed on your local machine
- For Force.com development on your local machine, you have Eclipse installed with the Force.com IDE (see ‘Force.com IDE Installation Instructions‘).
- To help integrate your local code with the main repository you have Atlassian SourceTree installed on your machine.
Available to you, with admin rights
- 1x LIVE instance of Salesforce.com;
- 3x Sandbox instances of Salesforce.com;
- For Source Control Repository you have Stash installed and running on the cloud;
- For Deployment Management, you have Bamboo installed and running on the cloud.
Setting up Bamboo / Stash
Working with Stash and committing Salesforce changes
Automating Deployments using Bamboo
9 – Ideas / hints / tips for advanced use of Stash / Bamboo;
10 – Branching strategies for Salesforce.com development.
Notes and Further Links
- Using the Force.com Migration Tool – useful information on how to use the Salesforce.com Ant Migration tool for deploying metadata across environments.