部loying a package using the UI
To deploy a Debian package to Artifactory, in the Artifacts Repository Browser, click部loy.
Select your Debian repository as theTarget Repository,upload the file you want to deploy.
Check the部loy as Debian Artifactcheckbox and fill in theDistribution, Component一个ndArchitecturefields in theDebian Artifactsection. Notice that theTarget Pathis automatically updated to reflect your input.
Setting the target path manually? Be careful with spaces
We recommend using the fields in theDebian Artifactsection to set yourTarget Path. Nevertheless, if you choose to specify theTarget Pathmanually, make sure you don't enter any superfluous spaces.
For exampleto upload packageplanckdb-08-2015.deb, and specify that its layout is from thetrustydistribution, in themaincomponent and thei386架构中,你将进入:
pool/planckdb-08-2015.deb;deb.distribution=trusty;deb.component=main;deb.architecture=i386
You can also deploy Debian packages to Artifactory with an explicit URL usingMatrix Parameters.
After you deploy the artifact, you need to wait about one minute for Artifactory to recalculate the repository index and display your upload in the Repository Browser.
Once you have deployed your Debian package, and Artifactory has recalculated the repository index, your repository should be organized as displayed below:
部loying a package using Matrix Parameters
The URL is built similarly to theTarget Pathformat as follows:
PUT "http://SERVER_HOSTNAME:8081/artifactory/{debianRepoKey}/pool/{debianPackageName};deb.distribution={distribution};deb.component={component};deb.architecture={architecture}"
For example, to upload packagelibatk1.0_i386.d
eb, and specify that its layout is from thewheezydistribution, in themaincomponent and thei386架构中,你将进入:
PUT "http://localhost:8081/artifactory/debian-local/pool/libatk1.0_i386.deb;deb.distribution=wheezy;deb.component=main;deb.architecture=i386"
Setting the Target Path
TheTarget Pathneeds to be entered in a strict and specific format that uses system properties to define where the artifact will be stored and its specific layout as follows:
[path];deb.distribution=[distribution];deb.component=[component];deb.architecture=[architecture]
path |
The repository path where the package should be stored. Artifactory supports storing Debian packages anywhere within the repository. The examples on this page show Debian packages stored under thepoolfolder in accordance with the Debian convention. |
distribution |
The value to assign to thedeb.distribution property used to specify the Debian package distribution |
component |
The value to assign to thedeb.component property used to specify the Debian package component name |
一个rchitecture |
Thevalue to assign to thedeb.architecture property used to specify theDebian package architecture |
Adding Architecture Independent Packages
deb.architecture=all
will cause it to appear in the Packages index of all the other architectures under the same Distribution and Component, as well as under a new index branch calledbinary-all
which holds all Debian packages that are marked as "all'.Specifying multiple layouts
Whether uploading a package using the UI or Matrix Parameters, you can specify multiple layouts for any Debian package you upload, by including additional values for the distribution, component or architecture separated by a comma,
For example, to upload packagelibatk1.0_i386.deb
to bothwheezy一个ndtrustydistributions, in bothmain一个ndcontribcomponents and bothi386一个nd64bit-arm一个rchitectures you would specify the following Target Path to upload using the UI:
池/ libatk1.0_i386.deb; deb.distribution =老生常谈的;德b.distribution=trusty;deb.component=main;deb.component=contrib;deb.architecture=i386;deb.architecture=64bit-arm
Correspondingly, to upload the file using Matrix Parameters, you would use the following:
PUT "http://localhost:8081/artifactory/debian-local/pool/libatk1.0_i386.deb;deb.distribution=wheezy;deb.distribution=trusty;deb.component=main;deb.component=contrib;deb.architecture=i386;deb.architecture=64bit-arm"
Artifact Metadata
Artifactory writes several entries from the Debian package's metadata一个s properties on all of the artifacts(based on the control file's content).
These properties can be used to search for Debian packages more efficiently using Arifactory's Package Search.
Metadata properties are written for each new Artifact that is deployed to Artifactory.
To have these properties written to Debian artifacts that already exist in your repositories you need to call theCalculate Debian Repository MetadataREST API which writes the properties to all of the artifacts by default.
Metadata Validation
To ensure that Debian repositories are not corrupted by malformed packages, Artifactory first validates parts of the Debian metadata to make sure that none of the relevant metadata fields are empty. If the validation process indicates a malformed package, Artifactory provides several indications:
- The package is not indexed
- The package is annotated with the following property:
关键:deb.index.status
- value: the reason the package failed the validation process
- If the package is selected in the Tree Browser, the Debian Info tab will display a message indicating that it was not indexed and why it failed the validation process
- A message is logged in the Artifactory log file indicating that the package was not indexed and why it failed the validation process.
Disable validation
debian.metadata.validation
system property. Package validation is enabled by default. To disable Debian package validation set:debian.metadata.validation=false
Finding malformed packages
To easily find all malformed packages in your Debian repositories, you can useProperty Searchor run an AQL query withProperties Criteriaon thedeb.index.status
property described above.
Remote Repositories
You can download Debian packages from Local Debian Repositories as described above, or from Remote Repositories specified as supporting Debian packages.
To specify that a Remote Repository supports Debian packages, you need to set itsPackage TypetoDebianwhen it is created.
Note that the index files for remote Debian repositories (including the sources index) are stored and renewed according to theRetrieval Cache Periodsetting.
Calculating Debian Coordinates
You can extract the component/distribution/architecture coordinates from a remote repository and assign them as properties on the cached packages.
To do this, right click on the relevant remote Debian repository and selectCalculate Debian Coordinates. You can also use theCalculate Cached Remote Debian Repository CoordinatesREST API.
This process may take some time for remote repositories with many packages. It is recommended running it only when needed.For example, before copying packages to a local repository.
The following executions will only calculate the newly added packages to the cache.
Virtual Repositories
A Virtual Repository defined in Artifactory aggregates packages from both local and remote repositories.
This allows you to access both locally hosted Debian packages and remote proxied Debian repositories from a single URL defined for the virtual repository.
To define a virtual Debian repository, create a virtual repository, set thePackage Typeto beDebian,一个nd select the underlying local and remote Debian repositories to include in theBasicsettingstab.
部recated Trivial layout not supported
Only repositories with an Automatic Layout can be included in a virtual repositories. A deprecatedTriviallayout is not supported for virtual repositories.
Indexed Remote Architectures
When creating a new virtual repository, theIndexed Remote Architecturesfield specifies the architectures which will be indexed for the included remote repositories.
Specifying these architectures will speed up Artifactory's initial metadata indexing process. The default architecture values are一个md64
一个ndi386
.
Set theOptional Index Compression Formatswith the index file formats you would like to create in addition to the default Gzip (.gzip extension).
Signing Debian Metadata
Artifactory supports signing Debian repository metadata (not packages) using a GPG key. This process will create a signed Release file namedRelease.gpg
, which will be shipped alongside the Release file. Artifactory will store and manage public and private keys that are used to sign and verify Debian packages.
To generate a pair of GPG keys and upload them to Artifactory, seeManaging Signing Keys.
Working with Debian Snapshots
Creating Debian Snapshots
From Artifactory 7.41.3, Debian repositories include support for Debian Snapshots.A Debian Snapshot contains metadata of a fixed state of a local, remote or virtual Debian repository. Snapshots are immutable and contain a metadata folder for each specific distribution, including all metadata files, likeRELEASES AND PACKAGES
, and not the actual packages.
Snapshots can be used in the following scenarios:
- As backups, allowing you to easily fall back to previous versions in case of package corruption due to dependency changes.
- For release purposes, whereby the tested Packages file can be immutably saved and served.
In Artifactory, the Debian snapshots are saved by default under the$repoKey/snapshots/$tag
subfolder within the Debian Repository and are created using a dedicated Create Debian Snapshot REST API.
In the following example,一个Debian snapshot named 202203141800
is saved under thedeb-snapshot
local repository, containingfocal
distribution metadata.
Rules and Guidelines
- To work with Debian Snapshots in Artifactory, you need to configure the sources file of your Debian client to point to the following path: artUrl/artifactory/api/deb/$repoKey/snapshots/$tag.
- The root of thesnapshot
sub-repository
is$repoKey/snapshots/$tag
. - All the metadata files of the
$srcRepo/dists/$distribution
, including the release and packages file, are copied to the snapshot folder. - In the folder, a property called
deb.snapshot.sourc
eis created pointing to the source repository. - You need to use
/artifactory/api/deb/$repoKey/snapshots/$tag
, whereby the tag is a user-defined name for the snapshot. - Deleting a snapshot does not delete the related Debian Package files as the.Debian
Snapshots
sub-repositories does not contain the packages, but only redirect to them.
To create a Debian Snapshot, see theCreate Debian SnapshotREST API.
Resolving Debian Snapshots
To work with Debian Snapshots in Artifactory, you need to configure the sources file of your Debian client to point to the following path:一个rtUrl/artifactory/api/deb/$repoKey/snapshots/$tag
.
Adding MD5 Checksum to the Packages file
To support tools (e.g.Aptly) that require Debian packages to include their MD5 checksum in theirPackages
metadata file for validation, you can configure Artifactory to add this value by setting the following system property in the artifactory.system.properties file:
## Add package MD5 checksum to Debian Packages file #artifactory.debian.metadata.calculateMd5InPackagesFiles=true
Artifactory needs to be restarted for this change to take effect.
Authenticated Access to Servers
If you need to access a secured Artifactory server that requires a username and password, you can specify these in your Debiansource.list
file by prefixing the artifactory host name with the required credentials as follows:
http://user:password@SERVER_HOSTNAME:8081/artifactory/{repoKey} {distribution} {components} For example: http://admin:password@localhost:8081/artifactory/debian-local wheezy main restricted
Encrypting your password
You can use your encrypted password as described inUsing Your Secure Password.
Compression Formats
Artifactory supports the following compression formats for Debian indices:
Gzip
(.gz
file extension) - created bydefault for every Debian repository and cannot be disabled.Bzip2
(.bz2
file extension)LZMA
(.lzma
extension)XZ
(.xz
extension)
Acquiring Packages by Hash
Artifactory supports the acquire-by-hash functionality of APT clients for Debian repositories laid out using the Automatic architecture (Trivial architecture is not supported for acquiring packages by hash). This feature is supported by twosystem properties:
一个rtifactory.debian.use.acquire.byhash | [default: true] When true, the value of acquire-by-hash in Debian release files is set to true allowing APT clients to access Debian packages by their checksums (MD5, SHA1, SHA256). To allow this, Artifactory will add the "by-hash" layout to all Debian repositories |
一个rtifactory.debian.packages.byhash.history.cycles.to.Keep | [default: 3] Specifies the number of cycles of package file history to save when acquire-by-hash is enabled |
Using Debian InRelease metadata files
From version 7.4, Artifactory supports Debian InRelease metadata files.
Artifactory will produce anInRelease
metadata file in the repository when working with GPG signing. Downloading a Debian package from Artifactory will now be faster as the client will only download theInRelease
file without downloading theRelease
一个ndRelease.gpg
files that are heavier.
REST API Support
The Artifactory REST API provides extensive support for Debian signing keys and recalculating the repository index as follows: