Deploy Updated Code to Your Packaging Org

In this exercise, you will…

  • Use force:mdapi:deploy to move updated code to your packaging org
  • Verify that the new components you deployed were automatically added to your package

Use force:mdapi:deploy to move updated code to your packaging org

Execute this command:

sfdx force:mdapi:deploy \
    -d mdapi-source/updated-package \
    -u PkgOrg \
    -l RunLocalTests \
    -w 15
Salesforce DX Command / Flags Description
force:mdapi:deploy Deploys file representations of components into an org by creating or updating the components they represent.
-d (--deploydir) The root of the directory tree that contains the files to deploy. The root must contain a valid package.xml file.
-u (--targetusername) A username or alias for the target org. Overrides the default target org.
-l (--testlevel) Specifies which level of deployment tests to run.
-w (--wait) The number of minutes to wait for the command to complete. The default is –1 (no limit)

After executing the above, your terminal should look something like this:

Verify that the new components you deployed were automatically added to your package

Open up your Packaging Org again and enter setup to take the following steps.

  1. In Setup, click on the Home tab.
  2. Type “package” in the Quick Find box.
  3. Click the Package Manager menu item.
  4. Make sure you click into the Package Detail page for My Managed Package (or whatever your package’s name is)
  5. Review the metadata components that are currently in your package. Note that the new components were added automatically as part of the deploy because you had included the package name as part of the deployment.

Updated: