Personal tools
     DOCUMENTATION

rBuilder:Command Line

From rPath Wiki

Jump to: navigation, search
rBuilder --> Command Line

The rBuilder Command Line Interface (CLI), also called the rBuilder client, provides rBuilder operations outside of the web interface using a command prompt. Using the CLI, rBuilder users can automate rBuilder tasks on an rBuilder Appliance (rBA).

To use the rBuilder CLI, install and configure the rBuilder client and use the rBuilder CLI commands to perform tasks on the rBA such as creating users, adding users as project owners or developers, creating builds in a project, and displaying project information. Add the commands to scripts to automate these tasks.

Note that these are activities that use the rBuilder's existing repository contents, imitating many of the actions that can be taken in the rBuilder web interface. To add packages and groups to an rBuilder project's repository, use Conary package and group building to establish a build environment and commit and cook troves in the repository.

Install and Configure the rBuilder CLI

Install the rBuilder CLI from the rbuilder package, and configure it in a file called .rbuilderrc in the current user's home directory.

Install rbuilder

   Currently, the rBuilder Command Line is only available for installation on 64bit [x86_64] clients.

Prior to installing the rBuilder client on a machine, copy the rBA entitlement from /etc/conary/entitlements/products.rpath.com on the rBA to the same location on the client machine. Copy the rBA entitlement from /etc/conary/entitlements/rap.rpath.com on the rBA to the same location on the client machine as well.

After copying the entitlements, run the following commands:

chmod 644 /etc/conary/entitlements/products.rpath.com
chmod 644 /etc/conary/entitlements/rap.rpath.com
sudo conary update rbuilder=products.rpath.com@rpath:rba-4 --config 'searchPath group-rbuilder-dist=products.rpath.com@rpath:rba-4' --resolve


Use man rbuilder for help on the rbuilder command, or see the rBuilder CLI instructions for detailed information.

You must configure the rBuilder CLI before using the associated commands. See the next section for configuration instructions.

Configure rbuilder using ~/.rbuilderrc

Create a text file with the configuration for the rBuilder CLI, and save the file as ~/.rbuilderrc. This consists of a single directive, which is a serverURL line in the following format:

serverUrl http://<username>:<password>@<rbuilder>/xmlrpc-private/

The user credentials (<username> and <password>) should match that of a project owner or developer on an rBuilder project, and <rbuilder> is the fully qualified domain name of the rBuilder instance.

Image:Bulbgraph.png   The rbuilder operations can only be performed by one user at a time, so only one serverUrl line is necessary. If there are multiple lines, the last line will be the effective user.

Use rBuilder CLI Commands

After you install and configure the rBuilder CLI, use the commands outlined here to perform tasks on rBuilder. Execute these commands manually, or include them in scripts to automate rBuilder tasks.

Click each linked command or option to scroll to its definition and examples.

COMMANDS
OPTIONS
--config="<key> <value>"
--config-file=<path>
--debug
-h , --help
--version

build-create

rbuilder build-create <project_name> '<full_appliance_identity>' <image_type> [--wait] [--timeout <seconds>] [--option "<key> <value>"]

Syntax

Use this command to create a build based on the provided information:

The command returns a build ID in a form suitable for use with eval. This provides something like BUILD_ID=100 in standard output.

Use --wait to cause the command to block until the build completes. This is an immediate block to prevent other commands from executing on the build until the process is complete. To execute subsequent commands on the build prior to waiting, leave out the --wait option and use build-wait after the subsequent commands.

Use --timeout to force the rbuilder command to exit after the specified number of whether the build has completed or not.

Use --option "<key> <value>" to set particular build options where <key> is the name of the option and <value> is the specific value you want to use. Use --option multiple times to to specify multiple options.

The options corresponding to each build type are as follows:

installable_iso
anaconda-custom, anaconda-templates, autoResolve, baseFileName, betaNag, bugsUrl, installLabelPath, maxIsoSize, media-template, mirrorUrl, showMediaCheck, swapSize
live_iso
autoResolve, baseFileName, installLabelPath, mirrorUrl, unionfs, zisofs
raw_fs_image
autoResolve, baseFileName, freespace, installLabelPath, mirrorUrl, swapSize
raw_hd_image
autoResolve, baseFileName, freespace, installLabelPath, mirrorUrl, swapSize
tarball
autoResolve, baseFileName, installLabelPath, mirrorUrl, swapSize
virtual_pc_image
autoResolve, baseFileName, freespace, installLabelPath, mirrorUrl, swapSize, vhdDiskType
virtual_iron
autoResolve, baseFileName, freespace, installLabelPath, mirrorUrl, swapSize, vhdDiskType
vmware_esx_image
autoResolve, baseFileName, freespace, installLabelPath, mirrorUrl, natNetworking, swapSize, vmMemory
vmware_image
autoResolve, baseFileName, diskAdapter, freespace, installLabelPath, mirrorUrl, natNetworking, swapSize, vmMemory, vmSnapshots
ami
autoResolve, freespace, amiHugeDiskMountpoint, baseFileName, installLabelPath
update_iso
baseFileName, media-template
appliance_iso
autoResolve, bugsUrl, media-template, betaNag, anaconda-templates, installLabelPath, anaconda-custom, baseFileName, showMediaCheck

The options listed correspond to the advanced options in the rBuilder interface for each build type. The syntax for using each option is as follows:

--option='autoResolve <value>'
Automatically install required dependencies during updates (values: 1 or 0; default: 0)
--option='anaconda-custom <value>'
Version of the anaconda-custom trove to use
--option='anaconda-templates <value>'
Version of the anaconda-templates trove to use
--option='baseFileName <value>'
Custom prefix for filenames output from the build (default: name-version-architecture)
--option='betaNag <value>'
Alert message displayed during install that this build is a beta (values: 1 or 0; default: 0)
--option='bugsUrl <value>'
Specify a URL where appliance users can obtain assistance, shown in the help screens displayed during install (default: http://issues.rpath.com/)
--option='diskAdapter <value>'
Hard disk adapter, SCSI or IDE, for which the image should be built (values: lsilogic or ide; default: lsilogic)
--option='freespace <value>'
Free space in MB that should be allocated in the image (default: 250)
--option='installLabelPath <value>'
Custom Conary installLabelPath Conary configuration value from which the appliance will install and update software (default is blank to let the value be a Conary default)
--option='maxIsoSize <value>'
ISO size (default: 681574400)
--option='media-template <value>'
Version of the media-template trove to use
--option='mirrorUrl <value>'
rPath Mirror URL from which the appliance will obtain Conary configuration settings (default is blank)
--option='natNetworking <value>'
Use NAT instead of bridged networking (values: 1 or 0; default: 0 to use bridged)
--option='showMediaCheck <value>'
Prompt the installing user whether to test the CD/DVD media before installation (values: 1 or 0; default: 0)
--option='swapSize <value>'
Swap space in MB that should be reserved in this image (default: 128)
--option='unionfs <value>'
Enable UnionFS for the entire filesystem (requires the UnionFS kernel module; values: 1 or 0; default: 0)
--option='vhdDiskType <value>'
VHD hard disk type (values: dynamic, fixed, difference; default: dynamic)
--option='vmMemory <value>'
Memory in MB that VMware should use when running the image (default: 256)
--option='vmSnapshots <value>'
Allow VMware snapshot creation within the image (value: 1 or 0; default: 0)

Examples

The following are examples of using the build-create command in the rbuilder client.

$> conary rq group-example --full-versions --all-flavors
group-example=/example.rpath.org@corp:devel/2.0-2-2[dietlibc,domU,~!grub.static,~kernel.debugdata,~!kernel.pae,~kernel.smp,sasl,~!vmware,xen is: x86(mmx,~!sse2)]
group-example=/example.rpath.org@corp:devel/2.0-2-2[dietlibc,~!domU,~!grub.static,~kernel.debugdata,~kernel.pae,~kernel.smp,sasl,~!vmware,~!xen is: x86(~!sse2)]
group-example=/example.rpath.org@corp:devel/2.0-2-2[dietlibc,~!domU,~!grub.static,~kernel.debugdata,~!kernel.pae,~kernel.smp,sasl,vmware,~!xen is: x86(~!sse2)]
group-example=/example.rpath.org@corp:devel/2.0-2-2[~!dietlibc,domU,~grub.static,~kernel.debugdata,~!kernel.pae,~kernel.smp,sasl,~!vmware,xen is: x86 x86_64]
group-example=/example.rpath.org@corp:devel/2.0-2-2[~!dietlibc,~!domU,~grub.static,~kernel.debugdata,~!kernel.pae,~kernel.smp,sasl,vmware,~!xen is: x86 x86_64]
group-example=/example.rpath.org@corp:devel/2.0-2-2[~!dietlibc,~!domU,~grub.static,~kernel.debugdata,~!kernel.pae,~kernel.smp,sasl,~!vmware,~!xen is: x86 x86_64]

$> rbuilder build-create exampleapp1 'group-example=/example.rpath.org@corp:devel/2.0-2-2[~!dietlibc,
~!domU,~grub.static,~kernel.debugdata,~!kernel.pae,~kernel.smp,sasl,~!vmware,~!xen is: x86 x86_64]' 
installable_iso --option="bugsUrl http://issues.example.com/"
BUILD_ID=100

$> rbuilder build-create exampleapp1 'group-example=/example.rpath.org@corp:devel/2.0-2-2[dietlibc,
~!domU,~!grub.static,~kernel.debugdata,~!kernel.pae,~kernel.smp,sasl,vmware,~!xen is: x86(~!sse2)]'
vmware --option="vmMemory 256"
BUILD_ID=101

build-url

rbuilder build-url <build-id>

Syntax

Use this command to list the URLs of each file created by build <build-id>.

Examples

The following is an example of using the build-url command in the rbuilder client.

rbuilder build-url 100

build-wait

rbuilder build-wait <build-id> [--timeout <seconds>]

Syntax

Use this command to block commands on <build-id> until it has finished building. Use the --wait option with build-create to block immediately when the build creation starts, or use build-wait to start the wait after subsequent commands on the build. Use --timeout to force the rbuilder command to exit after the specified number of whether the build has completed or not.

Examples

The following is an example of using the build-wait command in the rbuilder client.

rbuilder build-wait 100 --timeout 120

config

rbuilder config

Syntax

Use this command to display the rbuilder configuration settings currently in use. If you do not have not yet created ~/.rbuilderrc, you will be asked to set the serverUrl configuration option in ~/.rbuilderrc.


project-add

rbuilder project-add <username> <project-name> <owner|developer>

Syntax

Use this command to add an rBuilder user named <username> to an existing rBuilder project named <project-name>. Use owner or developer to designate the user as a project owner or developer.

Examples

The following is an example of using the project-add command in the rbuilder client.

$ rbuilder project-add exampleuser exampleapp1 developer

user-create

rbuilder user-create <username> <email> [--password <password>]

Syntax

Use this command to create a new rBuilder user named <username> with an email address of <email>. Use --password to set the password for the user; if a password is not set, you will be prompted to enter one.

Examples

The following is an example of using the user-create command in the rbuilder client.

$ rbuilder user-create exampleuser exampluser@example.com --password eX@mpl3

--config="<key> <value>"

Syntax

Use this option to set configuration setting <key> to value <value>. Currently, serverUrl is the only key for the configuration, and it will overwrite the existing serverUrl line in ~/.rbuilderrc. The command syntax is as follows where <username> and <password>) match the user credentials for a project owner or developer on an rBuilder project, and <rbuilder> is the fully qualified domain name of the rBuilder instance.

$ rbuilder --config="serverUrl http://<username>:<password>@<rbuilder>/xmlrpc-private/"

--config-file=<path>

Syntax

Use this option to direct rbuilder to use the configuration file <path> as its configuration file for the single execution of the rbuilder command.

Examples

The following is an example of using the --config-file option in the rbuilder client.

rbuilder build-create exampleapp1 group-app1 installable_iso --config-file=~/app1config

--debug

Syntax

Use this option to display debugging information. This command has not yet been implemented and will currently redirect to epdb, a Python debugger, if there are any problems.


--help

Syntax

Use this option to display rbuilder command usage information. Use either -h or --help

Examples

The following is an example of using the --help option in the rbuilder client:

$ rbuilder build-create --help

--version

Syntax

Use this option to display the rbuilder version.

Examples

The following are examples of using the --version option in the rbuilder client.

$ rbuilder --version
2.0.2