conan-quickstart
Prerequisites
- Ensure you have the Conan CLI (
conan) installed on your local machine. - Access to a Harness account with appropriate permissions to create registries and connectors.
Create a Conan artifact registry
- Interactive Guide
- Step-by-Step
- Navigate to the Artifact Registry module in your Harness project.
- Click on New Artifact Registry.
- In the Registry Type dropdown, select Conan Registry.
- Provide a Registry Name.
Your registry name must start with a letter and can include lowercase alphanumerics, _, . and -.
- Optionally, add a Description and Labels for better organization.
- Choose visibility between Public and Private.
- Click Create Registry to finalize.
This registry will serve as your private Conan registry within Harness.
Configure an Upstream Proxy (Optional)
An upstream proxy allows your registry to fetch Conan packages from external sources if they are not available locally.
- Interactive Guide
- Step-by-Step
Create an upstream proxy
Configure the upstream proxy in your registry
Create an upstream proxy
- In the Artifact Registry module, click the dropdown next to New Artifact Registry and select Upstream Proxy.
- Choose Conan Registry as the proxy type.
- Click Create Proxy to establish the connection.
Configure the upstream proxy in your registry
- In the Artifact Registry module, select an existing Artifact Registry.
- Select the Configuration tab.
- Under Advanced (Optional), select Configure Upstream.
- Select from the list of compatible proxies to add them to your registry.
- Click Save to save the configuration.
If a Conan package is not found in your Harness registry, the upstream proxy can fetch it from an external source like Conan Center, helping to reduce duplication and ensure reliable access to public packages.
Navigate Conan packages in the UI
Conan packages use the recipe reference name/version@user/channel (for example <ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL>). Drill down in this order:
- Registry → Packages: open a package from the list.
- Versions: each row is a version and user/channel pair. Expand a row to list recipe revisions (RREV), then open one to reach Artifact Details.
- Artifact Details: use the header dropdowns to switch version, channel, or recipe revision.
Files vs Packages
Conan stores files and binaries for each recipe revision. Harness shows them on separate tabs in Artifact Details:
Files (recipe revision): The recipe and exported sources for name/version@user/channel#rrev. This tab answers "what is the recipe?"
conanfile.py: the Conan recipe that defines build steps and dependencies.conan_sources.tgz: source files exported with the recipe.conanmanifest.txt: checksum manifest for the recipe files.
Copy MD5, SHA1, SHA256, or SHA512 checksums, or download individual recipe files from this tab.
Packages (binary packages): Prebuilt binaries for that recipe revision. This tab answers "which builds exist for this recipe?"
Each row is a package ID: one binary for a specific settings profile (OS, compiler, architecture, build type) and options (such as shared and fPIC). The latest PREV column shows the latest package revision for that binary.
| Tab | Conan term | What you see |
|---|---|---|
| Files | Recipe revision (RREV) | Recipe, sources, and manifest |
| Packages | Package ID and package revision (PREV) | Built binaries per configuration |
Full binary reference format:
<ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL>#<RREV>:<PACKAGE_ID>#<PREV>
Readme and Dependencies show readme content and the dependency graph for the selected recipe revision when available.
Go to Artifact management to download at the package, version, or file level.
Publish & Install Conan Packages
Configure authentication
An identity token serves as the password for the Conan remote.
- In your Harness Conan Artifact Registry, click Set Up Client and generate an identity token.
- Add the registry as a Conan remote:
conan remote add <REMOTE_NAME> https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/conan
- Authenticate with your identity token:
conan remote login <REMOTE_NAME> <your-email@harness.io> -p <TOKEN>
Publish a package
Build the package locally:
conan create .
Upload it to the registry. Include the user and channel from your conanfile.py:
conan upload <ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL> -r <REMOTE_NAME> --confirm
Install a package
Install a package from the registry:
conan install --requires=<ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL> -r <REMOTE_NAME>