For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cargo

spinner

Prerequisites

  • Ensure you have the Cargo CLI (cargo) installed on your local machine.

  • Access to a Harness account with appropriate permissions to create registries and connectors.


Create a Cargo artifact registry

Create a Cargo Artifact Registry in Harness
  1. Navigate to the Artifact Registry module in your Harness project.

  2. Click on New Artifact Registry.

  3. In the Registry Type dropdown, select Cargo Registry.

  4. Provide a Registry Name.

REGISTRY NAME CRITERIA

Your registry name must start with a letter and can include lowercase alphanumerics, _, . and -.

  1. Optionally, add a Description and Labels for better organization.

  2. Choose visibility between Public and Private.

  3. Click Create Registry to finalize.

PRIVATE REGISTRY

This registry will serve as your private Cargo registry within Harness.


Configure an Upstream Proxy (Optional)

An upstream proxy allows your registry to fetch Cargo packages from external sources if they are not available locally.

Create an upstream proxy

Create a Cargo Upstream Proxy in Harness

Configure the upstream proxy in your registry

Configure Cargo Upstream Proxy in Harness

Create an upstream proxy

1. In the Artifact Registry module, click the dropdown next to **New Artifact Registry** and select **Upstream Proxy**. 2. Choose **Cargo Registry** as the proxy type. 3. Click **Create Proxy** to establish the connection.

Configure the upstream proxy in your registry

1. In the Artifact Registry module, select an existing Artifact Registry. 2. Select the **Configuration** tab. 3. Under **Advanced (Optional)**, select **Configure Upstream**. 4. Select from the list of compatible proxies to add them to your registry. 5. Click **Save** to save the configuration.

UPSTREAM PROXY CACHING

If a Cargo package isn’t found in your Harness registry, the upstream proxy can fetch it from an external source like Cargo.io, helping to reduce duplication and ensure reliable access to public packages.


Publish & Install Cargo Packages

Configure authentication

  • In your Harness Cargo Artifact Registry, click Setup Client.

  1. Create or update your ~/.cargo/config.toml file and add the following configuration:

After creating your new Cargo registry, you will need to set up a client to authenticate with the registry.

  1. Click Generate token to generate a new identity token for CLI access.

  2. Create or update your ~/.cargo/credentials file and add the following configuration:

Publish a package

Publish your package with the following command:

Install a package

Install your package with the following command:


Last updated

Was this helpful?