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.
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.
- Create a new repo (We are using this option for this demo)
- Use existing repo
Once all good and connected you should see the success popup :
If you go to your github account you should be able to see the repo that was created :
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
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:
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.
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.
If the sandbox you are connecting is not ready for source tracking you will get this error.
But if you already have that shorted out you will see the below screen when done connecting to the sandbox.
You can add or remove steps from the pipeline. In this post i will remove all middle steps and directly move to production.
Once all done you will see the “Activate” button enabled
At this point there is no changes that can be migrated
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.
Once done you will see
The Development work
To start working create workitems
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.
For simplicity of explanation I added a custom field to the Dev1 sandbox
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.
If the reviewer is okay with the changes you just need to toggle the flag to make it ready for deployment.
Once approved you will now see the changes ready for deployment
Select the changes and click on Promote selected
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..
Leave a Reply