Releasing Date Based Snapshot of LSP/LTL

From LintouchWiki

Jump to: navigation, search

Contents

[edit] Target Audience

  • Anyone who is able to compile Lintouch from sources and install it.
  • Anyone who is able to compile Server Plugins and Template Libraries against existing Lintouch installation.
  • Anyone who wishes to be involved in Lintouch QA, release process, and automated snapshots.
  • Anyone who wants to get his hands dirty with QA Tools.

[edit] Goal of this Tutorial

After reading this tutorial, the reader should be able to generate date based snapshot of Template Library and/or Server Plugin that is in preparation for for regular release.

We will use lsp-modbus as an example in this process. Let us assume that we are going to prepare regular release 1.8.2 of lsp-modbus, and we want to first provide the users with a chance to test a date based snapshot (pre-release) and report back bugs before going on with final release.

[edit] Prerequsities

The reader should understand the following things:

  1. What is SVN, how to checkin/checkout something
  2. What is the usual organization of source code in SVN (product/{trunk,branches,tags})
  3. What is autoconf/automake, how to bootstrap autotools so that you can compile sources right out of SVN
  4. What does --prefix switch to ./configure
  5. What is pkg-config, PKG_CONFIG_PATH and how it works
  6. What is LD_LIBRARY_PATH and how it works

[edit] Preparing the Environment

We will use QA Tools and builder.lintouch.org machine to generate the required snapshot of lsp-modbus. If you do not have an access to the builder.lintouch.org machine, you can install QA Tools to your own machine and start experimenting.

[edit] Checking the dependencies

$ qat-suite-snapshot
/usr/local/bin/qat-suite-snapshot (QA Tools version 1.2)
usage is: /usr/local/bin/qat-suite-snapshot product-suite.conf
$ qmake --version
Qmake version: 1.07a (Qt 3.3.3)
Qmake is free software from Trolltech AS.
$ apr-config --version
0.9.6
$  apu-config --version
0.9.6
$ pkg-config --version
0.15.0
$ cppunit-config --version
1.10.0

[edit] Alternative 1: Snapshot Everything

We can use the brute-force method to generate date based snapshot of all products that are part of some suite. In our case the suite will be /usr/local/share/qa-tools/lintouch.suite. By examining that file you can see what products will be snapshotted, where they will be installed and where the resulting .tar.gz archives will go.

 PRODUCTS="
 lintouch.product
 lsp-exec.product
 lsp-modbus.product
 lsp-snmp.product
 ltl-elevator.product
 ltl-qwt.product
 "
 
 REPORTS="lintouch-email-reporting.conf"
 
 # export these so that they can be referenced from product files themselves
 export PREFIX="/tmp/lintouch-prefix"
 # use one of the following on site, depends on whether you want to generate
 # snapshots or regular release
 export RESULTDIR="${HOME}/public_html/snapshots/`date  %Y%m%d`/lintouch"
 #export RESULTDIR="${HOME}/public_html/releases/lintouch"

We will now use the qat-suite-snapshot command to generate .tar.gz archives of all PRODUCTS. The resulting archives will be copied to RESULTDIR and will be installed (for dependency checking) to PREFIX.

 $ qat-suite-snapshot /usr/local/share/qa-tools/lintouch.suite -t
 /usr/local/bin/qat-suite-snapshot (QA Tools version 1.2)
 Processing suite configuration file /usr/local/share/qa-tools/lintouch.suite
 Processing report configuration file /usr/local/share/qa-tools/lintouch-email-reporting.conf
 ...
 ...

[edit] Alternative 2: Snapshot only What Is Needed

If you examine what is happening when qat-suite-snapshot is invoked, you can simulate its behavior and filter out the actions you don't need. In our example we are interested in obtaining snapshot of lsp-modbus, and nothing more (because all the remaining sources are unchanged in SVN).

We will open the command prompt and invoke the following commands:

 $ source /usr/local/share/qa-tools/lintouch.suite
 $ export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
 $ export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH

These will setup all necessary environment variables needed by QA Tools, configure, and make check. We will now continue by generating a snapshot of Lintouch trunk (needed as a dependence of lsp-modbus) and installing it.

 $ qat-product-snapshot /usr/local/share/qa-tools/lintouch.product -t
 ...
 ...
 $ qat-product-install /usr/local/share/qa-tools/lintouch.product -t
 ...
 ...

Lintouch should be now installed in /tmp/lintouch-prefix, we can continue snapshotting lsp-modbus, the same way as lintouch, but using different product file.

 $ qat-product-snapshot /usr/local/share/qa-tools/lsp-modbus.product -t
 ...
 ...
 $ qat-product-install /usr/local/share/qa-tools/lsp-modbus.product -t
 ...
 ...

You should be able to find resulting .tar.gz files in RESULTDIR.

[edit] What we have Learned?

We have hopefully learned the following

  1. QA Tools can help you generating date based .tar.gz snapshots of products right out of SVN
  2. QA Tools use environment variables that influence their behavior
  3. QA Tools are just shell scripts that save some typing
  4. We don't need to be afraid reading the source code
Personal tools