Personal tools
     DOCUMENTATION

Appliance Development:Contexts

From rPath Wiki

Jump to: navigation, search
Image:Rpath-color-16x16-1bitalpha.png  APPLIANCE DEVELOPMENT

Contents

Conary interprets cvc and rmake commands according to a context. A context is a Conary configuration that ties a file system location to an rBuilder project or a particular label on that project. Appliance developers set up and maintain one or more context within a build environment.

Two things are required to set up contexts:

  • Directories within which to assemble packages and use Conary development tools
  • Conary configuration to direct Conary how to link the directories with the packaging commands

Create Directories

Create a directory structure which Conary associates with all packaging activities. rPath recommends creating a conary directory in your home directory on your Conary-based system. Then, create the following required subdirectories:

~/conary/builds -- where packages are actually built by Conary
~/conary/cache -- used by Conary to store the source archives downloaded during the build process, avoiding the necessity of repetitively downloading the same source archive each time you attempt a build

After creating these directories, create subdirectories for the contexts as described in the next section.

Image:Bulbgraph.png   Root access and root permissions are not necessary for Conary packaging. In fact, Conary does not allow developers to build as root in the build environment.

Edit Configuration and Add Context Entries

As mentioned in the Conary Configuration topic, rPath recommends packagers use $HOME/.conaryrc to configure a build environment. A packager's configuration should have the following:

  • Configuration directives that apply to the build environment as a whole
  • Context entries that apply to appliance projects or specific labels within projects

Use your preferred text editor to create a .conaryrc file in your home directory. The following is a typical $HOME/.conaryrc file, provided for reference. See the notes that follow for a description of its contents:

buildPath        /home/sampleuser/conary/builds
lookaside        /home/sampleuser/conary/cache
name             Sample User
contact          Sample.User@example.com
user             rbuilder.example.com sampleuser sampleuser_password
user             *.rpath.org rBuilder-Online-username rBuilder-Online-password

[edb-1-devel]
buildLabel        edb.example.com@corp:edb-1-devel
installLabelPath  edb.example.com@corp:edb-1-devel

The contents of this configuration file are as follows:

  • A buildPath and lookaside required to direct Conary to use the previously created build and cache directories
  • A name and contact address (email or website) used by Conary when source code is committed to a Conary repository
  • User lines for each rBuilder or individual project repository used in appliance building; requires rBuilder credentials that have write access to the corresponding repositories
  • A context entry specifying a context name and directives that apply only to that context (edb-1-devel in the example)

Packagers should add as many context entries as necessary to cover the projects and development stages on which development should occur. The following shows two context entries that correspond to designated labels predetermined by a corporate release management structure (described in a later section):

[edb-1-devel]
buildLabel        edb.example.com@corp:edb-1-devel
installLabelPath  edb.example.com@corp:edb-1-devel

[edb-2-devel]
buildLabel        edb.example.com@corp:edb-2-devel
installLabelPath  edb.example.com@corp:edb-2-devel
Image:Bulbgraph.png   rBuilder Online labels are always in the form of <projectname>.rpath.org@<branchname> in which projectname is the project name as used in the project's URL and branchname is either the default branch name for the project or another desired branch name.

Set Up Contexts

In ~/conary/, create directories to correspond to each context entry. rPath recommends packagers create a directory to represent a project, and to use subdirectories under the project for each label on the project. Run cvc context in each label-specific directory to set up the context based on the corresponding context entry. The following commands are used to set up a contexts for the edb-1-devel context entry:

$> mkdir ~/conary/edb
$> mkdir ~/conary/edb/edb-1-devel
$> cd ~/conary/edb/edb-1-devel
$> cvc context edb-1-devel


<< PREVIOUS: rBuilder Projects NEXT: Appliance Development main page >>