No Jenkins, no ant scripts, no installations needed.
Salesforce source control and release management is often seen as something complex, heavy and cumbersome. Adopting CI/CD generally requires your team to be highly technical not only within the Salesforce domain but also in the dev-ops space, think Jenkins, Ant Script, CLI, Git Integration, API version management, …
ClickDeploy.io is super flexible and you can setup any workflows you could imagine. In this blog, we will set up a process that looks like below.
A few things to note in the process above:
- GitHub is the source of truth of your production’s metadata. This enables version control, history tracking, code review, approval, audit, compliance, rollback and preventing code clobbering.
- ClickDeploy Daily CI job deploys metadata from GitHub to production. Making this daily allows your team to establish a predictable, frequent release schedule. It also enforces GitHub be the source of truth and systematically prevent attempts to make changes directly in production.
- Admins and developers would move changes from dev sandboxes to GitHub instead of moving changes directly to production like they used to with Change Sets.
- ClickDeploy Declarative Git Flow allows your less technical admins to move changes to GitHub in a few clicks without spending hours on editing XML, fiddling with ANT scripts or learning Git.
Implement This Process
What you need
- For demo purpose, we will use two Salesforce Developer Edition orgs, one acts as Dev environment and the other acts as Production environment. Sign up Developer Edition orgs for free via https://developer.salesforce.com/signup
- An empty GitHub repository.
- A free ClickDeploy.io account. There is no needs to purchase anything yet. Your enterprise trial is activated automatically.
Step 1: Add GitHub repo to ClickDeploy.io
In ClickDeploy.io, add a new organization of type GitHub and proceed with authorization, like below:
After you’ve added the GitHub org and the 2 Salesforce orgs, your org list would look like below.
For demo purpose, we call the 2 Salesforce orgs “Dev Org” and “Production” even though these are just Developer Edition orgs.
Step 2: Initialize your GitHub repository
We want to populate your empty GitHub repository with whatever in your production org. To do this, create a new Deployment, like this:
Select the types of metadata you want to track in your GitHub repo using Wildcard type, like this:
Use the Group filter to help you decide what to track. Code Related and Object Related is a good place to start. You can add other types later.
Hit Commit to Git Branch and ClickDeploy will commit the selected metadata to the target git branch.
Click Review Changes to see the metadata differences. Since your repo was empty, you’ll see a list of newly added files. In GitHub, create a pull request then merge to master. After which, your master branch in GitHub should look like below. By convention, ClickDeploy stores your metadata source in a folder named project .
Step 3: Setup your first CI Job
Your GitHub repo is now the source of truth. Create a CI job to do a daily deployment from GitHub to Production, like this:
Most teams prefer not to deploy on Friday in order to free team members from release support over the weekend. As above, ClickDeploy was built to meet very flexible scheduling requirement.
If you get this far, congratulations, you’ve just completed your first CI process. Let’s recap. You started by linking your GitHub repo with ClickDeploy.io. You then populated the repo with your production metadata. In the last step, you scheduled a daily job that deploys from your GitHub repo to your production org.
Now that you have source control and a CI process in place. Let’s find out how ClickDeploy can empower your team to work with Git effortlessly.