Imagine transforming your Salesforce deployments with just a few clicks. Copado Essentials Plus makes it effortless to deploy changes from Salesforce to Git, enabling seamless pull requests for code reviews. The best part? Once approved, merged branches automatically trigger CI Jobs to deploy changes back to Salesforce. It's DevOps made simple, even for those new to version control. No complex setups or steep learning curves β just an intuitive interface that streamlines your entire workflow. Ready to see how easy Salesforce DevOps can be?
The Deployment with Pull Request method deploys through your Git repository to allow for creating a pull request before updating the target branch and org. This provides an opportunity for oversight and approval.
Getting Started
Before we dive into the process, make sure you have a Git repository set up and connected to Copado Essentials Plus. If you need help with this, you can refer to our documentation on connecting or seeding a Git repository in Copado Essentials.
Setting up a CI Job Triggered via Webhook
To leverage the power of Deployments, Pull Requests, and automated CI Jobs in Copado Essentials Plus, start by setting up a webhook-triggered CI job. This enables automatic execution of your CI job whenever changes are merged into your target branch.
To create this CI job, navigate to the CI Jobs tab in Copado Essentials Plus and click 'New CI Job'. Provide a descriptive title for the job, select your Git branch as the source, and choose your target Salesforce environment. Next, specify the action you want the job to perform - Deploy, Validate, or Run Static Code Analysis. Then, select 'Triggered by git commit to branch' as the Webhook option.
β
Copado Essentials Plus simplifies the process by automatically generating a webhook URL. Click 'Setup Webhook' to access this URL, which you'll need to add to your Git repository settings. This URL is the key to triggering your CI Job in Copado Essentials Plus.
Once configured, save your CI job. This will bring you to the CI Job activity, where it's important to update what you want to have Copado Essentials Plus push from Git. If the goal is to have all approved changes deployed to Salesforce, navigate to the 'Deploy Options' subtab within your CI Job, and under the 'Git source' section, select the option 'deploy files committed since last successful build'. By default, Copado Essentials sets the last successful build marker to point to the head of the branch. If you click on "Review Pending Changes", you should see zero components in the queue after a successful deployment.It's that easy!
Now, every time changes are merged into your specified branch, this CI job will automatically run, automating your DevOps process.
Committing to Git via Deployment
With your CI job configured, it's time to commit changes to your target feature branch using Copado Essentials Plus. Navigate to the Deployments tab and click 'New Deployment'. Select your source Salesforce environment where changes were made, and choose your Git repository with the specified target branch. This branch will be used to create a new feature branch from, which you can customize the name of by clicking 'More' underneath the Target Org selection.
Once saved, Copado Essentials Plus guides you through the deployment process with its user-friendly interface. Utilize the intuitive Diff Key to easily select components for deployment. This visual aid helps you quickly identify New, Changed, or unchanged (Same) components, streamlining your selection process.
Before committing to Git, run any required tests directly within the Copado Essentials Plus platform, such as Unit Tests or Static Code Analysis, or even trigger test jobs within Copado Robotic Testing. You can even validate this deployment against any target environment using the 'More' dropdown menu, ensuring your changes are compatible before they're committed to Git for approval.
Once you're satisfied with your deployment package, simply click 'Commit to Git Branch'. Copado Essentials Plus will then create a feature branch and commit your changes, setting the stage for a pull request. This streamlined process aims to make feature branch creation and pull requests accessible to teams of all experience levels.
Facilitating a Pull Request
Once Copado Essentials Plus has successfully committed your changes to Git, click 'Review Changes' to be taken directly to the branch that was created to initiate the pull request. The next steps in your DevOps process will differ slightly based on your chosen Git provider, and Copado Essentials Plus supports major Git providers including GitHub, GitLab, Bitbucket, and Azure DevOps, as well as Copado's own Version Control system.
As part of the Pull Request process, you can leverage any custom automations or approval workflows you've set up in your repository. While the specific steps may vary depending on your Git provider, Copado Essentials Plus is designed to work harmoniously with your existing processes.
Merging Changes into a Target Branch to Trigger the CI Job
As soon as your pull request is merged into the target branch, the CI job you set up earlier springs into action. This is thanks to the webhook integration that Copado Essentials Plus provides, which automatically triggers the CI job upon merge.
Without any manual intervention, your changes are immediately processed according to the CI job's configuration. Whether you've set it to deploy, validate, or run static code analysis, Copado Essentials Plus handles it all seamlessly.
This automated process not only saves time but also reduces the risk of human error, ensuring a consistent and reliable deployment pipeline.
Conclusion
And that's it! You have successfully utilized deployments with pull requests and automated CI jobs in Copado Essentials Plus. As you can see, this method offers additional flexibility, oversight, and automation, helping to conform to pre-existing processes. So why wait? Start using this powerful feature today and streamline your deployment process through Git!