Juicer is a command-line interface to the Pulp REST API which provides a shopping cart style approach to uploading and promoting groups of packages or docker images through multiple environments.
The main documentation lives at http://juicer.readthedocs.org/en/latest/.
usage: juicer [-h] [-v] [-V] {cart,rpm,repo,role,user,hello} ...
manage pulp and release carts
optional arguments:
-h, --help show this help message and exit
-v, --verbose show verbose output
-V, --version show program's version number and exit
commands:
'juicer COMMAND -h' for individual help topics
{cart,rpm,repo,role,user,hello}
cart cart operations
rpm rpm operations
repo repo operations
role role operations
user user operations
hello test your connection to the pulp server
Creating a repository without specifying --in
will automatically create the repository in every configured environment.
juicer repo create my-repository
Or, a repository can be created in specific environments.
juicer repo create my-repository --in devel
Note
Repositories created by juicer have a relative path which includes the environments they were created in. If a repository was created in devel
, it would be available at https://<pulp-host>/pulp/repos/devel/
.
The Pulp repo_id
of a repository created by juicer will be display_name-environment
. A repository named test-repo
created in the devel
environment would have a repo_id
of test-repo-devel
.
This was done so that multiple environments can co-exist on a single Pulp node.
A cart is composed of repositories and packages.
juicer cart create my-cart -r my-repository ~/rpmbuild/RPMS/noarch/*.rpm
Multiple packages and repositories can be specified.
juicer cart create my-cart -r my-repository ~/rpmbuild/RPMS/noarch/*.rpm \
-r my-other-repository ./awesome.rpm /tmp/woah.rpm
Packages don't have to be local.
juicer cart create my-cart -r my-repository http://dang.com/rpms/omg.rpm
juicer cart push my-cart --in qa
A cart can be saved remotely once it has been pushed. This can be useful if the release engineer needs to swap mid-release. Add cart_seeds
(insecure mongo endpoint) to juicer configuration to enable remote saves. Remote carts can be pulled with juicer cart pull
.
juicer cart delete my-cart
juicer cart pull my-cart
juicer cart show my-cart
Juicer is configured through a ~/.config/juicer/config
file. The config is broken into sections by environment and may also contain an optional DEFAULT section, from which the defaults for all following sections are supplied.
The standard flow of this sample infrastructure goes from devel to prod; meaning that we upload our packages to devel and test them accordingly in our development environment before we promote them to prod.
[DEFAULT]
username: admin
password: admin
port: 443
verify_ssl: True
ca_path: /etc/pki/pulp/ca.crt
cert_filename: /etc/pki/pulp/pulp.crt
start_in: devel
cart_seeds: localhost:27017
[devel]
hostname: localhost
promotes_to: qa
[qa]
hostname: localhost
promotes_to: stage
[stage]
hostname: localhost
promotes_to: prod
[prod]
hostname: localhost
Juicer was built to work with Pulp version 2.6.0. We assume that you have a server up and running which Juicer can talk to. Installation instructions for Pulp are available here.
RPM packages are available for RHEL/Centos 7 and Fedora 21 & 22.
dnf copr enable abutcher/juicer
dnf install -y juicer
sudo python ./setup.py install
Run make ci
to install dependencies within your local checkout. This will create an isolated Python virtualenv. The ci
Makefile target also runs our tests and checks PEP8 style formatting.
make ci
. juicerenv/bin/activate
juicer -h