1. Getting Started

1.1. Installation

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.

1.1.1. RPM Install

RPM packages are available for RHEL/Centos 7 and Fedora 21 & 22.

dnf copr enable abutcher/juicer
dnf install -y juicer

1.1.2. Source Install

sudo python ./setup.py install

1.2. Configuration

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
[DEFAULT]
username: testuser
password: testpass
port: 443
verify_ssl: False
ca_path: /home/testuser/certs/pulp.crt
cert_filename: /home/testuser/certs/client.crt
cart_seeds: testhost.re.example.com:27017
start_in: re

[re]
hostname: testhost.re.example.com
promotes_to: qa

[qa]
hostname: testhost.qa.example.com

1.3. Usage

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

1.3.1. Create a repository

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.

1.3.2. Create a cart

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

You can even provide an apache directory index (example: http://lnx.cx/~tbielawa/rpms/) as a source. The directory listing will be searched for links ending in .rpm. All matches will be added to the cart!

juicer cart create my-dir-cart -r my-repository http://son.com/rpms/
juicer cart show my-dir-cart
{
    "_id": "my-dir-cart",
    "repos_items": {
        "my-repository": [
            "http://son.com/rpms/megafrobber-1.0.3-2.noarch.rpm",
            "http://son.com/rpms/defrobnicate-ng-3.2.1-0.noarch.rpm",
        ]
    }
}

If you need to get more specific you can use fnmatch.fnmatch wildcard matching with apache directory indexes.

juicer cart create my-dir-cart -r my-repository http://son.com/rpms/mega*rpm
juicer cart show my-dir-cart
{
    "_id": "my-dir-cart",
    "repos_items": {
        "my-repository": [
            "http://son.com/rpms/megafrobber-1.0.3-2.noarch.rpm",
        ]
    }
}

1.3.3. Push a cart to an environment

Pushing a cart will upload all of its items to the specified environment.

juicer cart push my-cart --in qa

Note

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.

To further illustrate remote cart saving, we can delete our local cart and pull it down again.

juicer cart delete my-cart --local
juicer cart pull my-cart
juicer cart show my-cart

juicer cart pull will overwrite a local cart file if it exists.