DevOps Center

Salesforce DevOps Center: Streamline Your Development Process (Part 2 Of 2)

This is the final part of this series where we will see the Salesforce DevOps Center in action. If you have not yet got a chance to look at the previous post, here you have the link : Part 1 This will be mostly images, comment if you dont like this or you like some other kinds of post 🙂

The Action

Now that we are all done with the setup and assuming you have a github account with the cloned repo from Salesforce . Repo

Go to the DevOps center app in your app launcher and it should bring you to the Dashboard of DevOps center. Click New Project button to create a project and connect your github repo.

DevOps Center
DevOps Center
Connect DevOps Center and GitHub
Connect DevOps Center and GitHub
connection success
connection success

Once conneted you can click on “New Project” button again. This will happen only on first time. But you are already connected to the repo, you will see the below screen where you have two options.

  1. Create a new repo (We are using this option for this demo)
  2. Use existing repo
repository for my project
repository for my project

Once all good and connected you should see the success popup :

project created
project created

If you go to your github account you should be able to see the repo that was created :

Git repo
Git repo
list
List of projects

Now you are ready to connect the deployment pipeline to any org. If you click on “Click to Connect” it will give you options to select the org to deploy the changes to

Add Release Environment
Add Release Environment

Select the org where you want to deploy the changes. in this post I am using another developer org, so will choose Production Org. Follow the oAuth login flow and you should see the environments conntected:

connected environments
connected environments

Now click on the name of the Project and you should see the pipeline which needs to be connected to your orgs.

Define the Development org

Define the stage for this org and connect to the Salesforce environment. There could be multiple orgs SIT, UAT etc.

Finally the master or the produciton org where the changes will be deployed.

Click on Add Development Environment to give DevOps center the login access to the development org.

Add Development Environment
Add Development Environment

Before you can use a sandbox for this you must have the sandbox as Source Tracking sandbox. You can enable sandboxes to be sourcetracking under your Dev Hub settings and any sandbox you create after this point will have source tracking enabled.

Source tracking sandbox
Source tracking sandbox

If the sandbox you are connecting is not ready for source tracking you will get this error.

Can't add environment
Can’t add environment

But if you already have that shorted out you will see the below screen when done connecting to the sandbox.

sandbox connected
sandbox connected

You can add or remove steps from the pipeline. In this post i will remove all middle steps and directly move to production.

steps
steps

Once all done you will see the “Activate” button enabled

Activate
Activate

At this point there is no changes that can be migrated

No changes
No changes

Because Salesforce can’t determine this environment’s ancestry, DevOps Center needs to deploy all changes from the first pipeline stage’s branch to this development environment to ensure it’s up to date. So you will see the below screen that it’s not in sync.

Not in sync
Not in sync
Synchronization Options
Synchronization Options

Once done you will see

Up to date
Up to date

The Development work

To start working create workitems

no work
No work

Once you create the WorkItem the system will checkout the main branch from Git and create a new branch for the work. At this point you can go to your git hub and see the new branch created for you.

Branch created
Branch created
Git branch
Git branch

For simplicity of explanation I added a custom field to the Dev1 sandbox

Custom field added
Custom field added

Once you are done with the changes go ahead and click on pull changes on the work item. You can also add items manually if you dont see anything in there. This is a good place where you can add review process to the flow to maintain the code quality and release management cleaner.

changes
changes

If the reviewer is okay with the changes you just need to toggle the flag to make it ready for deployment.

Ready for deployment
Ready for deployment

Once approved you will now see the changes ready for deployment

Approved
Approved

Select the changes and click on Promote selected

Promote
Promote

Now you wil see the changes in Git as well as in your production. If there was any failures you can see them here too.

Conclusion

This is the end of the 2 part series and hope this will help you get started. There are a lot of automation that can be done on this and I can see the benefit of this to all the salesforce customers. This was a basic step but this is really helpful and better for profile management as well.

Till next time keep reading and sharing..

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *