Packages

Updated 1 month ago by Copado Solutions

Overview

With packages you can move to a  modular approach for Salesforce development process. A package is a logical set of metadata that represents a subset of an org. Packages can be tested independently from other components in your org, and you should be able to release them independently as well. 

The metadata components within a package can only live in one package at a time.  All source for your packages is stored in your package repository. Copado takes care of the handling process for you. 

You can define two types of packages:

  1. Git Package
    1. Version Control Package.
  2. Salesforce Package
    1. Salesforce Unmanaged Package.

How to Create a Git Package

Once you have completed DX requirements, follow these steps:

  1. Create an empty Git repository in your Git server and initialize it.
    Use the same name for the Git repository both in your server and in the Package record.
  2. Create a Git Repository record in Copado with connection details to the previously created repository.
  3. Open the Packages tab, click on New to create a Package record.
    1. Select the Git Package record type. 
    2. Select the org credential for the environment that holds the metadata. 
    3. Select the repository created for the package.
    4. Save.
  4. Click on Manage Metadata.
    1. From the metadata grid, select the metadata to include in the package.
    2. Click on Save
If you are working with tags in Copado releases, your packages will be tagged accordingly.  

How to Create a Salesforce Package

Once you have completed DX requirements, follow these steps:

  1. Open the Packages tab and click on New to create a package record.
    1. Select the Salesforce Package record type. 
    2. Select the org credential for the environment holding metadata. 
    3. Save.
  2. Click on Manage Package Content.
    1. From the grid, select the Unmanaged Package to use for the package.
      1. If the package is new, click on Refresh List of Packages.
    2. Click on Save
If the package has a key, you can write it in the Package Key field.

Working with Packages

Once you have created a package, you can create a scratch org and load the metadata, making it ready for use as part of your user stories.

If a new component is created in the scratch org, and you try to commit it from a user story, Copado will prompt you to select the package where this new component should exist.

Applying tags to your packages will require that the user stories have a Release record related and the version field be filled in.

When the user story is promoted and then deployed, new elements will be pushed to the package repository (tagged with the same version as the Release record, if there is no version, push will be done but without tag). Metadata selection will be included in the Package record and a related package version record will be created.



How did we do?