Gemfile plugin for the Pulp Project
Project description
pulp_gem Plugin
This is the pulp_gem Plugin for Pulp Project 3.0+. This plugin adds importers and distributors for rubygems.
All REST API examples below use httpie to perform the requests. The httpie commands below assume that the user executing the commands has a .netrc file in the home directory. The .netrc should have the following configuration:
machine localhost
login admin
password admin
If you configured the admin user with a different password, adjust the configuration accordingly. If you prefer to specify the username and password with each request, please see httpie documentation on how to do that.
This documentation makes use of the jq library to parse the json received from requests, in order to get the unique urls generated when objects are created. To follow this documentation as-is please install the jq library with:
$ sudo dnf install jq
Install pulpcore
Follow the installation instructions provided with pulpcore.
Install pulp-gem from source
sudo -u pulp -i
source ~/pulpvenv/bin/activate
git clone https://github.com/ATIX-AG/pulp_gem
cd pulp_gem
python setup.py develop
pulp-manager makemigrations pulp_gem
pulp-manager migrate pulp_gem
django-admin runserver
sudo systemctl restart pulp_resource_manager
sudo systemctl restart pulp_worker@1
sudo systemctl restart pulp_worker@2
Install pulp-gem From PyPI
sudo -u pulp -i
source ~/pulpvenv/bin/activate
pip install pulp-gem
pulp-manager makemigrations pulp_gem
pulp-manager migrate pulp_gem
django-admin runserver
sudo systemctl restart pulp_resource_manager
sudo systemctl restart pulp_worker@1
sudo systemctl restart pulp_worker@2
Create a repository foo
$ http POST http://localhost:8000/pulp/api/v3/repositories/ name=foo
{
"_href": "/pulp/api/v3/repositories/1/",
"...": "..."
}
$ export REPO_HREF=$(http :8000/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "foo") | ._href')
Add a remote
$ http POST http://localhost:8000/pulp/api/v3/remotes/gem/ name='bar' url='https://rubygems.org/'
{
"_href": "/pulp/api/v3/remotes/gem/1/",
"..." : "..."
}
$ export REMOTE_HREF=$(http :8000/pulp/api/v3/remotes/gem/ | jq -r '.results[] | select(.name == "bar") | ._href')
Sync repository foo using remote bar
$ http POST ':8000'${REMOTE_HREF}'sync/' repository=$REPO_HREF
Upload foo-0.0.1.gem to Pulp
Create an Artifact by uploading the gemfile to Pulp.
$ http --form POST http://localhost:8000/pulp/api/v3/artifacts/ file@./foo-0.0.1.gem
{
"_href": "/pulp/api/v3/artifacts/1/",
"...": "..."
}
You need to upload the corresponding foo-0.0.1.gemspec.rz in the same way.
Create gem content from an Artifact
$ http POST http://localhost:8000/pulp/api/v3/content/gem/gems/ artifact="/pulp/api/v3/artifacts/1/"
{
"_href": "/pulp/api/v3/content/gem/gems/1/",
"artifacts": {
"gems/foo-0.0.1.gem":"/pulp/api/v3/artifacts/1/",
"quick/Marshal.4.8/foo-0.0.1.gemspec.rz":"/pulp/api/v3/artifacts/2/"
},
"name": "foo",
"notes": {},
"type": "gem",
"version": "0.0.1"
}
$ export CONTENT_HREF=$(http :8000/pulp/api/v3/content/gem/gems/ | jq -r '.results[] | select(.name == "foo") | ._href')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pulp-gem-0.0.1b1.tar.gz
.
File metadata
- Download URL: pulp-gem-0.0.1b1.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d54b6cda5d004b8ed865603901df9ec44ff470e0379b60f230c91f3611360a |
|
MD5 | c689c8d65bf5bbdf2f734d51b39ce9e6 |
|
BLAKE2b-256 | 42237972707fa52b3e92a0b8dcd62e5784515d35410c1efa0972cdc7ddda088d |
File details
Details for the file pulp_gem-0.0.1b1-py3-none-any.whl
.
File metadata
- Download URL: pulp_gem-0.0.1b1-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3afa5290be6b64430a11cd6d9b1c10bebab6b572c9dd438fb2c0f1741b4eb2d4 |
|
MD5 | 31dc90dd05f98372bedaba272519ef40 |
|
BLAKE2b-256 | f46c559d74ac124250e45160185e548a2721585594c13b8bd3cceec9f796be3c |