Cargo
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
Navigate to the Artifact Registry module in your Harness project.
Click on New Artifact Registry.
In the Registry Type dropdown, select Cargo Registry.
Provide a Registry Name.
Optionally, add a Description and Labels for better organization.
Choose visibility between Public and Private.
Click Create Registry to finalize.
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
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.
Publish & Install Cargo Packages
Configure authentication
In your Harness Cargo Artifact Registry, click Setup Client.
Create or update your
~/.cargo/config.tomlfile and add the following configuration:
After creating your new Cargo registry, you will need to set up a client to authenticate with the registry.
Click Generate token to generate a new identity token for CLI access.
Create or update your
~/.cargo/credentialsfile 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?