Package Distribution

Updated 1 month ago by Copado Solutions

Overview

A package is a logical set of metadata that represents a subset of an org. With packages, you can move to a modular approach to the Salesforce development process, as they can be tested independently from other components in your org and can also be released independently. 

In Copado we split the package delivery into the following main scenarios:

  • Environment Based: Install packages on destination environments in parallel.
  • Pipeline Based: Install packages sequentially on orgs that belong to a pipeline.
  • Automated: Determine package installation based on conditions.

Let's take a closer look at each of these types of packages.

Environment Based Package Distribution

Imagine, you are a release manager and need to ensure that a specific version of a package is installed, ideally in parallel to save time,  in one or more orgs that belong to different pipelines. You can do this with the Environment Based Package Distribution feature that allows you to select the package version and the destination environments. Copado will then install the package as well as the dependencies on the destination orgs you have selected. 

Now, let’s see how you can achieve this. Once you have created the package in Copado and want to install it in different environments, you’ll need to follow the steps below:  

  1. Navigate to the Package tab and select the package you want to distribute.
  2. Click on Distribute Package.
  3. Select the Package Version and click Next.
  4. For Distribution Type select Environment and click Next.
  5. Select the Org Credentials and click on Next. The org credentials are displayed depending on your sharing settings and system admin permissions. 
  6. A Package confirmation detail page will appear, if everything is correct, click on Next.  In case there are package dependencies, they are also installed.
  7. Verify the selected environment credentials and click Next.
  8. A static list of job executions will be displayed. You can click each of the job executions and they will open in a new tab where you can check their status. When done, click on Finish

In the background, the deployments are launched with a job function that installs the package. You can review the details of this job under the Results tab. 

Pipeline Based Package Distribution

For some release managers, installing a package is not enough. The package version might need to go through approvals, or it might need to be enhanced with additional developments, like for example, adjusting a global template package to regional requirements. With Copado you can achieve this by choosing the Pipeline Based Package Distribution, which will link a package installation task to a story and each time the story changes the environment, an installation will be triggered. Of course, dependencies are considered and the story must pass the setted quality gates on each environment, which ensures that installations follow internal governance.

Now, let’s get deep on how you can create a pipeline based package distribution. Once you have created the package in Copado and want to install it sequentially in different orgs that belong to a pipeline, you’ll need to follow the steps below:  

  1. Navigate to the Package tab and select the package you want to distribute.
  2. Click on Distribute Package.
  3. Select the Package Version and click Next.
  4. For Distribution Type select Pipeline and click Next.
  5. In User Story Type you can select:
    1. Add to an existing Story: If you already have a user story created, select this option and click on Next.  
      1. A lookup field will appear where you need to select the related user story. Select it and click on Next
    2. Create New Story: If you don’t have a user story, select this option. 
      1. Select a Project and click on Next.
      2. Fill in the relevant fields for the New User Story and click on Next
  6. A confirmation page will appear with details of the user story. If everything is correct, click on Next.   
  7. A Package confirmation detail page will appear, if everything is correct, click on Next
  8. A Navigate to the User Story Record link will be displayed. Click on it if you want to navigate to the related user story, otherwise click on Finish
  9. Copado will create a deployment task, which will trigger the installation of the package version as well as the required dependencies each time the story is promoted.

Every time the user story is deployed, a deployment task is created and the package is installed. You can review the associated records under the Deployment Task Related list. 


How did we do?