How To Access And Upload Files In Existing Repositories
YUM Back up is Platform Independent!
Artifactory'southward RPM metadata calculation is based on pure Java.
It does non rely on the beingness of the createrepo
binary or on running external processes on the host on which Artifactory is running.
When enabled, the metadata calculation is triggered automatically by some actions, and tin can also be invoked manually past others. Either manner, the metadata produced is served to YUM clients.
Automatic
RPM metadata is automatically calculated:
- When deploying, removing, copying, and moving an RPM file.
- When performing content import (both organisation and repository imports).
Manual
You can manually invoke RPM metadata adding:
- By selecting the local repository in the Tree Browser and clickingRecalculate Index in theActions menu.
- Via Artifactory's Residual API.
Metadata calculation cleans upwards RPM metadata that already existed equally a outcome of manual deployment or import. This includes RPM metadata stored as SQLite database files.
Indexing the File List
The filelists.xml
metadata file of an RPM repository contains a list of all the files in each package hosted in the repository. When the repository contains many packages, reindexing this file as a effect of interactions with the YUM client can be resource intensive causing a degradation of functioning. Therefore, from version 5.4, reindexing this file is initially disabled when an RPM repository is created. To enable indexing filelists.xml
, fix the Enable File Listing Indexing checkbox.
Note that the filelists.xml
metadata file for a virtual repository may not be complete (i.e. it may not actually list all the files it aggregates) if any of the repositories it aggregates practice not have file listing enabled. Note that if indexing of the filelists.xml
file is disabled, it is not possible to search for a file using the YUM client to determine which bundle wrote the queried file to the filesystem.
Configuration
To create an RPM local repository, in the Administration module go to Repositories | Repositories | Local, click New Local Repository andselect RPM every bit the Package Type .
Local Repositories
To enable automated RPM metadata calculation on a local RPM repository, in theRPM Settings section of theBasic settings screen, setAutomobile-calculate RPM Metadata.
Field | Clarification |
---|---|
RPM Metadata Folder Depth | Informs Artifactory under which level of directory to search for RPMs and save the Past default this value is 0 and refers to the repository's root binder. In this example, Artifactory searches the unabridged repository for RPMs and saves the Using a dissimilar depth is useful in cases where generating metadata for a repository separates its artifacts by name, version and architecture. This volition let you to create multiple RPM repositories nether the same Artifactory RPM repository. For case: REPO_ROOT/$ARTIFACT_NAME/$ARTIFACT_VERSION/$ARCHITECTURE/FILE_NAME - or - rpm-local/foo/i.0/x64/foo-ane.0-x64.rpmm When changing the configured depth of existing repository, packages indexed in the old depth might need to be re-indexed or moved to a new depth to exist available in the new configured depth, and YUM clients might need to change their configuration to point to the new depth.depth. |
Auto-summate RPM Metadata | When set, RPM metadata adding is automatically triggered by the actions described higher up. |
Enable File List Indexing | When gear up, RPM metadata calculation will likewise include indexing the filelists.xml metadata file. |
RPM Group File Names | A comma-separated listing of YUM group files associated with your RPM packages. Note that at each level (depth), the |
Remote Repositories
Artifactory remote repositories support RPMs out-of-the-box, and there no demand for any special configuration needed in order to piece of work with RPMs in a remote repository.
All you demand to do ispoint your YUM customer at the remote repository, and yous are ready to utilize YUM with Artifactory.
To define a remote repository to proxy an RPM remote repository, follow the steps below:
- In theAdministration module underRepositories | Repositories | Remote, clickNew Remote Repository to create a new remote repository.
- Set theRepository Keyvalue, and specify the URL to the remote repository in theURLfield as displayed below.
- Click Save & Stop.
- Dorsum in the Awarding | Artifactory | Artifacts module, in theTree Browser, select the repository. Note that in the Tree Browser, the repository proper name is appended with
-cache
. - ClickSet up Me Upward and copy the value of the
baseurl
tag.
-
Side by side, create the
/etc/yum.repos.d/
targetCentos.repo
file andpaste the following configuration into it :[targetCentos] proper noun=targetCentos baseurl=http://localhost:8081/artifactory/targetCentos/ enabled=1 gpgcheck=0
Virtual Repositories
A Virtual Repository defined in Artifactory aggregates packages from both local and remote repositories.
This allows you to access both locally hosted RPM packages and remote proxied RPM repositories from a single URL defined for the virtual repository.
To ascertain a virtual YUM repository, from the Administration module, go toRepositories | Repositories | Virtual, set theBundle Typeto beRPM,and select the underlying local and remote RPM repositories to include in theBasicsettingstab.
To let deploying packages to this repository, prepare the Default Deployment Repository.
Artifactory supports using a GPG key to sign RPM metadata for authentication by the YUM customer.
To generate a pair of GPG keys and upload them to Artifactory, see Managing Signing Keys.
Installing RPM Packages Using Yum
After configuring the rpm-local
repository in Artifactory, you need to configure your local motorcar to install software packages from it by executing the post-obit steps:
-
Edit the
artifactory.repo
file with root privilegessudo vi /etc/yum.repos.d/artifactory.repo
-
Paste the following configuration into the
artifactory.repo
file:[Artifactory] name=Artifactory baseurl=http://localhost:8081/artifactory/rpm-local/ enabled=one gpgcheck=0
At present, every RPM file deployed to the root of the rpm-local
repository can be installed using:
yum install <package_name>
Deploying RPM Packages
Once yous have configured your local motorcar to install RPM packages from your RPM local repository, you may also deploy RPM packages to the aforementioned repository using the UI or using the REST API.
Through the Residual API y'all besides have the option to deploy by checksum or deploying from an archive.
For example, to deploy an RPM package into a repository chosen rpm-local you could apply the following:
curlicue -u<USERNAME>:<PASSWORD> -XPUT http://localhost:8080/artifactory/rpm-local/<PATH_TO_METADATA_ROOT> -T <TARGET_FILE_PATH>
where PATH_TO_METADATA_ROOT specifies the path from the repository root to the deploy binder.
Deploying RPM Modules to Your Local Repository
You tin can deploy RPM modules to the repodata
folder using the modules.yaml
file which contains all the desired modules and so continue to trigger a repository index to update the repomd.xml
and other metadata files with the modules information.
-
You tin perform the upload directly in the JFrog Platform UI or using the following command.
gyre -u <USERNAME>:<Password> -XPUT "http://localhost:8081/artifactory/rpm-local/<PATH_TO_REPODATA_FOLDER>/modules.yaml -T <TARGET_MODULES_FILE_PATH>"
- Trigger the reindex by running the Summate YUM Repository Metadata API.
YUM Groups
A YUM grouping is a set of RPM packages collected together for a specific purpose. For example, you might collect a set of "Development Tools" together as a YUM group.
A group is specified past adding a group XML file tosame directory every bit the RPM packages included in it. The grouping file contains the metadata of the group including pointers to all the RPM files that make up the grouping.
Artifactory supports attaching a YUM Group file to the YUM calculation essentially mimicking thecreaterepo -grand
command.
A grouping file can also be created by running the post-obit command:
sudo yum-groups-manager -n "My Group" --id=mygroup --save=mygroups.xml --mandatory yum glibc rpm
Attaching a YUM Group
The process of attaching YUM group metadata to a local repository is elementary:
- Create an XML file in the groups format used past YUM. You can either just type it out manually using whatever text editor, or run the
yum-groups-managing director
command fromyum-utils
. - Deploy the created group file to the
repodata
folder.
Artifactory will automatically perform the following steps:- Create the corresponding
.gz
file and deploy it next to the deployed group XML file. - Invoke a YUM calculation on the local repository.
- Attach the grouping information (both the XML and the
.gz
file) to therepomd.xml
file.
- Create the corresponding
- Make sure the group file names are listed in theYUM Grouping File Namesfield nether the Basic tab of the repository configuration. This tells Artifactory which files should be attached as repository group information.
YUM Group Commands
The following tabular array lists some useful YUM group commands:
Control | Description |
---|---|
| Install the YUM group. The grouping must be deployed to the root of the YUM local repository. |
| Remove the RPM grouping |
| Update the RPM group. The group must be deployed to the root of the YUM local repository. |
| List the RPM packages inside the grouping. |
| Listing the YUM groups |
Setting Grouping Properties
YUM grouping properties tin be fix in the /etc/yum.config
file as follows:
Setting | Allowed values | Description |
---|---|---|
overwrite_groups | 0 or 1 | Determines YUM's behavior if two or more than repositories offer package groups with the aforementioned proper name. If set to 1 then the group packages of the last matching repository will be used. If set up to 0 then the groups from all matching repositories will be merged together equally ane large group. |
groupremove_leaf_only | 0 or 1 | Determines YUM'southward behavior when the groupremove control is run. If prepare to 0 (default) then all packages in the group will be removed. If set to one then only those packages in the group that aren't required by another packet will be removed. |
enable_group_conditionals | 0 or one | Determines whether YUM will allow the use of conditionals packages. If set to 0 and then conditionals are not immune If set to 1 (default) parcel conditionals are immune. |
group_package_types | optional, default, mandatory | Tells YUM which type of packages in groups will be installed when groupinstall is called. Default is: default, mandatory |
Yum Authentication
Proxy Server Settings
If your arrangement uses a proxy server every bit an intermediary for Cyberspace access, specify theproxy
settings in /etc/yum.conf.
If the proxy server also requires authentication, you also demand to specify the proxy_username
, and proxy_password
settings.
proxy=<proxy server url> proxy_username=<user> proxy_password=pass
If yous utilise the yum plugin (yum-rhn-plugin
) to access the ULN, specify theenableProxy
andhttpProxy
settings in /etc/sysconfig/rhn/up2date.
In addition, If the proxy server requires authentication, you also need to specify theenableProxyAuth
,proxyUser
, andproxyPassword
settings as shown below.
enableProxy=1 httpProxy=<proxy server url> enableProxyAuth=one proxyUser=<user> proxyPassword=<password>
SSL Setting
YUM supports SSL from version 3.2.27.
To secure a repository with SSL, execute the post-obit steps:
- Generate a private primal and certificate using OpenSSL.
-
Define your protected repository in a
.repo
file every bit follows:[protected] name = SSL protected repository baseurl=<secure repo url> enabled=1 gpgcheck=1 gpgKey=<URL to public key> sslverify=i sslclientcert=<path to .cert file> sslclientkey=<path to .key file>
where:
gpgkey is a URL pointing to the ASCII-armored GPG cardinal file for the repository . This selection is used if YUM needs a public key to verify a package and the required key has non been imported into the RPM database.
I f this selection is set, YUM will automatically import the key from the specific URL. You will exist prompted earlier the key is installed unless theassumeyes
choice is set.
Using Yum Variables
Yous can use and reference the following built-in variables in yum
commands and in all YUM configuration files (i.east. /etc/yum.conf
and all .repo
files in the /etc/yum.repos.d/
directory):
Variable | Description |
---|---|
| This is replaced with the package'due south version, as listed indistroverpkg . This defaults to the version of the redhat-release package. |
| This is replaced with your system's compages, as listed byos.uname() in Python. |
| This is replaced with your base architecture. For example, if$arch =i686 so$basearch =i386 |
The following code cake is an example of how your /etc/yum.conf
file might expect:
[primary] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=one gpgcheck=ane plugins=1 installonly_limit=3 [comments abridged]
Viewing Individual RPM Information
Yous can view all the metadata that annotates an RPM by choosing it in Artifactory's tree browser and selecting theRPM Info tab:
Metadata Fields as Properties
The corresponding RPM metadata fields are automatically added equally properties of an RPM antiquity in YUM repositories accessed through Artifactory:
-
rpm.metadata.name
-
rpm.metadata.arch
-
rpm.metadata.version
-
rpm.metadata.release
-
rpm.metadata.epoch
-
rpm.metadata.group
-
rpm.metadata.vendor
-
rpm.metadata.summary
Backdrop can be used for searching and other functions. For more details come across Property Sets.
Scout the Screencast
Watch this short screencast to learn how easy information technology is to host RPMs in Artifactory.
Source: https://www.jfrog.com/confluence/display/JFROG/RPM+Repositories
Posted by: thomascolore41.blogspot.com
0 Response to "How To Access And Upload Files In Existing Repositories"
Post a Comment