Creating a New Namespace (2GPL)

Who is this guide written for?

This guide is intended for Olympus-Grid developers responsible for creating new package configurations for clients, Independent Software Vendors (ISVs), or enterprises white-labeling Olympus-Grid technology. It assumes familiarity with Salesforce environments and development workflows.


Pre-Requisites

Before you begin, ensure you have the following:

  1. Access to your Salesforce Business Org with the appropriate permissions.

  2. Environment Hub enabled and properly configured in the Salesforce Business Org.

  3. Salesforce CLI installed and configured on your local machine.

  4. GitHub Actions enabled and a repository set up for the project.

  5. Namespace registration approval (if required by your organization).


Procedure

Step 1: Log Into Your Salesforce Business Org

  1. Open your browser and navigate to the Salesforce login page.

  2. Log in using your admin credentials for the Salesforce Business Org.

  3. Verify that you have access to the Environment Hub. If not, contact your Salesforce admin to enable it.

Step 2: Create a New Org Using Environment Hub

  1. Navigate to the Environment Hub tab within your Salesforce Business Org.

  2. Click Create Org and select the type of org needed (e.g., Developer, Scratch Org, or Production).

  3. Fill out the required details and submit the request.

  4. Wait for the new org creation confirmation email and follow the instructions to activate the new org.

Step 3: Sign Into the New Org and Create a Namespace

  1. Log in to the new org using the activation link provided.

  2. Navigate to Setup and search for Package Manager in the Quick Find box.

  3. Click Namespace Settings and follow the prompts to create a new namespace.

    • Ensure the namespace is unique and aligns with your project or client branding.

  4. Save the namespace configuration.

Step 4: Add the Namespace to the Namespace Registry in the Salesforce Business Org

  1. Return to your Salesforce Business Org.

  2. (Optionally) This is a good time to setup SSO from your environment hub entry to your new namespace org.

  3. Navigate to Setup and search for Namespace Registry in the Quick Find box. Use the "Link Namespace" button in the Namespace Registries List view.

  4. Add the new namespace by successfully logging into the namespace org during the linking process.

  5. Verify the new namespace appears in the registry.

Step 5: Create the Package Locally

  1. Open your terminal or command line interface.

  2. Create the package (this is a one time operation)

    1. sf package create --name "Olympus-Grid" --description "Elevate Your Cloud" --package-type Managed --path force-app --target-dev-hub biz-org -o [email protected]
  3. Obtain the Package Id (e.g. (0HoPj00000000o1KAA)

  4. Create the package version

    1. sf package version create --package 0HoPj00000000o1KAA --path force-app --code-coverage --target-dev-hub biz-org --wait 10 --installation-key-bypass
  5. Notice the package identifier and the package version identifier are written to the sfdx-project.json

    1. {
        "packageDirectories": [
          {
            "versionName": "Olympus-Grid",
            "versionNumber": "0.3.0.NEXT",
            "ancestorVersion": "NONE",
            "path": "force-app",
            "default": true,
            "package": "Olympus-Grid",
            "versionDescription": "Olympus-Grid"
          }
        ],
        "name": "Olympus-Grid",
        "namespace": "og_beta_5",
        "sfdcLoginUrl": "https://login.salesforce.com",
        "sourceApiVersion": "60.0",
        "packageAliases": {
          "Olympus-Grid": "0HoPj00000000o1KAA",
          "[email protected]": "04tPj000005QwALIA0"
        }
      }
    2. Commit this file to the repository

  6. CumulusCI should locally be able to also create a version running the local flow command.

Step 6: Setup Github Actions for continuous integration

  1. Find the dev-hub-auth-url and set it up as a github secret for the repository

    1. sf org display --json --verbose
  2. Commit and push the changes to trigger the pipeline.

Reference:

https://cumulusci.readthedocs.io/en/stable/github-actions.html


Need Help?

If you encounter any issues or need assistance, please reach out to [email protected]. We’re here to help!

Last updated