configurationengine/doc/intro.rst
author m2lahtel
Tue, 10 Aug 2010 14:29:28 +0300
changeset 3 e7e0ae78773e
parent 0 2e8eeb919028
permissions -rw-r--r--
ConE 1.2.11 release
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     1
Introduction
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     2
============
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     3
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     4
ConE installation offers three different use scenarios of the tool.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
#. ConE API (read, write)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
#. ConE plugin API (A plugin interface to add functionality to ConE)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
#. ConE command line interface (tools/utilities that use the API)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
3
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    10
ConE API introduction
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    11
---------------------
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
The ConE API tries to offer a simple way to access the configurations inside the Configuration
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
project. The concepts of confml and the Configuration project are quite complicated, but the API
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
simplifies the project quite a bit to enable effective programming. Although the API aims for 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
simplicity, everything is made available via the API.
3
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    16
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    17
The API is described in :ref:`cone-api` with a :ref:`cone-api-howto` and with python api documentation tool *epydoc*. 
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
3
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    19
ConE plugin (extension) API
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    20
---------------------------
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
The purpose of the plugin API is to offer the possibility to expand the functionality of Configuration project. Normal use case
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
is an implementation plugin which reads data from the configuration and transforms it into some other form 
3
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    23
(e.g. centralrepository text file). 
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
3
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    25
See :ref:`plugin-api`.
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    26
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    27
ConE command line interface introduction
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    28
----------------------------------------
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
The main purpose of ConE is to offer the above APIs, but ConE installation as tool
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
offers also set of command line utilities that can used to modify, read and utilize (generate other output files 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
with implementation plugins) from a Configuration project. These utilities lie on the cone-script package and 
3
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    32
are described in the ConE command line interface section. 
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    33
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
    34
See :ref:`cone-cli`
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
Installation
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
Requirements
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
ConE installation requires:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
* Python 2.5 (though 2.6 probably works too)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
* Ant (Required for installing from source)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
* Python setuptools - http://pypi.python.org/pypi/setuptools. (Required to install ConE as part of python)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    48
ConE can be installed in two different ways:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    49
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    50
1. In the Python environment under site-packages like any other Python package
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    51
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    52
  - Makes it possible to use the ConE API from Python scripts
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    53
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    54
2. As a standalone installation in a separate directory
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    55
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    56
  - Contains the CLI and a set of plug-ins
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    57
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    58
Installing from source
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    59
^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    60
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    61
In order to install from source, you obviously need to first get the ConE sources:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    62
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    63
* Clone the Mercurial repository:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    64
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    65
  * ``hg clone https://developer.symbian.org/sfl/MCL/sftools/depl/swconfigmdw/``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    66
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    67
* -- or -- checkout from SVN (if you are in Nokia intranet):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    68
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    69
  * ``svn checkout https://trace1.isource-nokia.nokia.com/isource/svnroot/cone/trunk cone_src``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    70
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    71
**Installing under site-packages**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    72
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    73
Simply install using ``setup.py`` like for any Python package:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    74
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    75
* ``cd cone_src/source``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    76
* ``python setup.py install``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    77
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    78
This will install the ConE core module into your Python environment. To install a plug-in,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    79
do the same in the desired plug-in's source directory (e.g. ``cone_src/plugins/common/ConeRulePlugin``).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    80
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    81
**Installing the standalone ConE**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    82
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    83
The normal installation in windows environment creates a directory containing the needed
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    84
libraries and ConE plug-ins, and a ``cone.cmd`` wrapper script. The directory can then
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    85
be added somewhere into your PATH, and then the CLI can be used by running ``cone``.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    86
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    87
To install, run:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    88
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    89
* <windows> ``install.cmd /path/to/install common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    90
* <linux> *Not available yet*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    91
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    92
Notice the parameter ``common`` in the install command. This specifies the plug-in package to install.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    93
It can be omitted, in which case it defaults to ``common``. Replace this with e.g. ``symbian`` to create
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    94
a Symbian-specific ConE installation.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    95
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    96
.. note::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    97
    Currently the standalone installation is Windows-specific in the sense that only a batch file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    98
    wrapper (``cone.cmd``) is included and some Symbian-specific plug-ins have dependencies to
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    99
    Windows applications and Python libraries with native components. However, the ``common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   100
    plug-in package should contain only pure Python, so it should work in Unix. Also, a ``cone.sh``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   101
    script is available under ``source/``, which can be used to replace ``cone.cmd`` in Unix.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   102
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   103
Install from ZIP
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   104
^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   105
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   106
Fetch the latest ConE build from our CruiseControl build server (works only in Nokia intranet):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   107
  
3
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
   108
* Goto https://trace1.isource-nokia.nokia.com/trac/cone/wiki/ConeReleases
e7e0ae78773e ConE 1.2.11 release
m2lahtel
parents: 0
diff changeset
   109
* Download the release zip file from ConE releases.
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   110
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   111
The ZIP file should contain a pre-built standalone installation described in the previous section.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   112
Simply unzip it where you please.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   113
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   114
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   115
.. _installation-export-tests:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   116
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   117
Standalone test set
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   118
^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   119
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   120
A standalone ConE installation can be tested using an automated standalone test set, which tests the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   121
ConE CLI functionality. Like the ``install`` command, exporting the test set also needs to
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   122
be given the plug-in package name (it wouldn't make much sense to test a Symbian ConE
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   123
installation using a Maemo-specific test set).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   124
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   125
* Export the test set:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   126
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   127
  * ``cd cone_src``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   128
  * <windows> ``export_bat.cmd /path/to/tests common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   129
  * <linux> *Not available yet*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   130
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   131
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   132
.. warning::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   133
    The path specified as the target path will be cleared before the actual
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   134
    export takes place, so be sure not to pass anything like C:\\ there.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   135
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   136
* Run the test set:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   137
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   138
  * Copy the ConE installation to test into ``/path/to/tests/cone/``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   139
  * ``cd /path/to/tests``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   140
  * ``runtests.cmd``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   141
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   142
You can also run the tests so that a standalone ConE installation is built and then tested
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   143
with its corresponding test set:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   144
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   145
  * ``cd cone_src``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   146
  * <windows> ``run_bat.cmd /path/to/tests common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   147
  * <linux> *Not available yet*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   148
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   149
If you simply want to test that ConE works correctly on your machine, you can
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   150
also run:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   151
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   152
  * ``ant test``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   153
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   154
This will export the test set, install ConE and run the tests inside a temporary
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   155
build directory in the working copy.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   156
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   157
Build and install debian packages (Maemo)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   158
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   159
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   160
  1. Install tools and cone dependencies, as root or with sudo.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   161
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   162
    * ``sudo apt-get install dpkg-dev fakeroot python-setuptools python-central``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   163
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   164
  2. Build python-cone and cone-tool. The packages are placed in parent directory.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   165
   
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   166
    * ``cd cone/trunk``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   167
    * ``dpkg-buildpackage -rfakeroot -b``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   168
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   169
  3. Install the binary packages, as root or with sudo.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   170
   
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   171
    * ``sudo dpkg -i ../python-cone*.deb ../cone-tool*.deb``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   172
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   173
  4. Install Jinja2 (not part of all Debian-based distros)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   174
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   175
    * ``sudo easy_install Jinja2``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   176
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   177