rpm-quickstart
Last updated on
Prerequisites
- Ensure you have RPM CLI installed and configured on your local machine.
- Ensure you have access to a Harness account with the appropriate permissions to create registries and connectors.
Create an RPM 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 list, select RPM Registry.
- Provide a Registry Name.
registry name
This registry name must start with a letter and can only contain lowercase alphanumerics,
_,.and-, and must be unique to your Harness Account. - Optionally, add a Description and Labels for better organization.
- Choose visibility between Public and Private.
- Click Create Registry to finalize.
private rpm registry
This registry will serve as your private RPM registry within Harness.
Configure an Upstream Proxy (Optional)
An upstream proxy allows your registry to fetch RPM packages from external sources if they are not available locally.
- Interactive Guides
- 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 RPM Registry as the proxy type.
- Enter an upstream proxy name.
- Enter your remote registry URL.
- Choose your Authentication method (
Anonymousby default). - 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.
upstream proxy caching
If an RPM package isn’t found in your Harness registry, the upstream proxy fetches it from an external registry like RPM, reducing duplication and improving package resolution.
Setup Client
With your RPM registry created, you can now authenticate the RPM CLI with your Harness registry using YUM or DNF.
- YUM
- DNF
- Step-by-step
- In your Harness RPM Artifact Registry, click Setup Client.
1. Configure Authentication
- Click Generate Token to generate an identity token for authentication.
installation and upload
Whether you use YUM or DNF, the process is similar
2. Install an RPM package
- Create or edit your
.repofile:
sudo vi /etc/yum.repos.d/<rpm-registry-name>.repo
yum default
YUM and DNF both default to the yum.repos.d directory.
- Add
.repofile content:
[<rpm-registry-name>]
name=<rpm-registry-name>
baseurl=https://pkg.app.harness.io/pkg/<account-id>/<rpm-registry-name>/rpm
enabled=1
gpgcheck=0
username=<username>
password=<token-from-step-2>
- Clear your YUM or DNF cache:
sudo <yum-or-dnf> clean all
- Install the RPM package:
sudo <yum-or-dnf> install <artifact-name>
3. Upload an RPM package
- Run the following cURL command with your package file:
curl --location --request PUT 'https://pkg.app.harness.io/pkg/<account-id>/<rpm-registry-name>/rpm/' \
--form 'file=@"<FILE_PATH>"' \
--header 'x-api-key: <API_KEY>'
- Click Done to complete your client setup.