ARTIFACTORY: A necessity for storing external debian packages locally, calculate your coordinates

ARTIFACTORY: A necessity for storing external debian packages locally, calculate your coordinates

AuthorFullName__c
Nandini Das
articleNumber
000005485
ft:sourceType
Salesforce
FirstPublishedDate
2022-11-30T09:58:14Z
lastModifiedDate
2023-01-22T11:07:24Z
VersionNumber
2

We often get requests from our customers about artifacts that have been pulled from a remote repository and been cached locally, that now need to be moved to a different location or otherwise treated as if they were in a local Artifactory repository.

There are a few reasons why users might want to do this, some below:

-Auditing a new package that has been pulled externally and then saving it to a local repository to control access to external packages developers can pull.

-The upstream repository is no longer accessible.

-Migration to a new Artifactory instance.

In all cases, the most important thing for users to remember is that the key to being able to successfully interact with packages in a repository is the package metadata, which allows clients to recognize the repositories and packages in Artifactory as legitimate.

When a package is pulled from an upstream repository through a remote repository, the upstream repository will already contain the metadata, so that will be pulled along with the package and stored in the remote repository’s cache. When a package is deployed to Artifactory to a local repository, Artifactory uses information about the published package to calculate the metadata and deploy it in the repo alongside the package.

For Debian packages that are published to local repositories, users include the distribution, architecture, and component of the package when publishing. These are saved as properties on the deployed artifact.

User-added image

Artifactory uses these properties to calculate the relevant metadata files, such as the Packages.gz and Release files.

Packages that are pulled from external sources, however, do not have these properties associated, as this is an Artifactory specific feature.

To solve this, we have the following API call that will apply these properties to files that have been cached in remote repositories so that Artifactory will be able to calculate the metadata if need be.

https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CalculateCachedRemoteDebianRepositoryCoordinates
 

curl -u user:<Password> -X POST http://<Art URL>/api/deb/indexCached/<remote repo name>-cache

For long term storage of externally cached Debian artifacts, remember to run this call regularly to ensure that you will always be able to calculate your Debian metadata.