website annotate en/doc/cookbook/build-bot.html @ rev 511

Add Cookbook page about SliTaz Build Bot (tazbb)
author Christophe Lincoln <pankso@slitaz.org>
date Sat Jun 20 00:16:20 2009 +0200 (2009-06-20)
parents
children fcffabc05cb1
rev   line source
pankso@511 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
pankso@511 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
pankso@511 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
pankso@511 4 <head>
pankso@511 5 <title>SliTaz Cookbook (en) - Build Bot</title>
pankso@511 6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
pankso@511 7 <meta name="description" content="slitaz English cookbook" />
pankso@511 8 <meta name="expires" content="never" />
pankso@511 9 <meta name="modified" content="2009-06-20 00:10:00" />
pankso@511 10 <meta name="publisher" content="www.slitaz.org" />
pankso@511 11 <meta name="author" content="SliTaz contributors"/>
pankso@511 12 <link rel="shortcut icon" href="favicon.ico" />
pankso@511 13 <link rel="stylesheet" type="text/css" href="book.css" />
pankso@511 14 </head>
pankso@511 15 <body bgcolor="#ffffff">
pankso@511 16
pankso@511 17 <!-- Header and quick navigation -->
pankso@511 18 <div id="header">
pankso@511 19 <div align="right" id="quicknav">
pankso@511 20 <a name="top"></a>
pankso@511 21 <a href="build-host.html">Build host</a> |
pankso@511 22 <a href="index.html">Table of contents</a>
pankso@511 23 </div>
pankso@511 24 <h1><font color="#3E1220">SliTaz Cookbook (en)</font></h1>
pankso@511 25 </div>
pankso@511 26
pankso@511 27 <!-- Content. -->
pankso@511 28 <div id="content">
pankso@511 29 <div class="content-right"></div>
pankso@511 30
pankso@511 31 <h2><font color="#DF8F06">Build Bot (tazbb)</font></h2>
pankso@511 32
pankso@511 33 <p>
pankso@511 34 The goal of Tazbb is to automate, test and report packages building from a
pankso@511 35 wok. Run <code>tazbb usage</code> for the list of available commands with
pankso@511 36 a short description. Status of Tank Build Bot via Tazbb web interface at
pankso@511 37 <a href="http://bb.slitaz.org/">bb.slitaz.org</a> and for collaboration:
pankso@511 38 <a href="http://labs.slitaz.org/wiki/distro/Tazbb">Tazbb Wiki</a>.
pankso@511 39 </p>
pankso@511 40
pankso@511 41 <ul>
pankso@511 42 <li><a href="#about">How it works</a></li>
pankso@511 43 <li><a href="#cmds">Commands</a></li>
pankso@511 44 <li><a href="#wok">Hg and chroot Wok</a></li>
pankso@511 45 <li><a href="#log">Log files</a></li>
pankso@511 46 <li><a href="#web">Web interface</a></li>
pankso@511 47 <li><a href="#hg-hook">Hg hook</a></li>
pankso@511 48 <li><a href="#cron">Cron Job</a></li>
pankso@511 49 <li><a href="#db">Database Files</a></li>
pankso@511 50 </ul>
pankso@511 51
pankso@511 52 <a name="about"></a>
pankso@511 53 <h3>How it works</h3>
pankso@511 54 <p>
pankso@511 55 Tazbb can be run by a cron job and check the last commit done by contributors
pankso@511 56 and then cook modified packages. Runnning 'tazbb cook-commit' will just
pankso@511 57 rebuild last modified packages, to rebuild all missing, modified or unbuilt
pankso@511 58 packages you must use 'tazbb cook-all'.
pankso@511 59 </p>
pankso@511 60 <p>
pankso@511 61 Generating report will source all receipt in the wok and check if the package
pankso@511 62 file exist, if not we add the package name in the current cooklist. For
pankso@511 63 existing packages we compare all files date in the Hg wok (receipt, stuff)
pankso@511 64 to the package.tazpkg file date, if it differ we add the package to the cooklist.
pankso@511 65 </p>
pankso@511 66 <p>
pankso@511 67 Tazbb must also look in the chroot wok to check if the package is built, there
pankso@511 68 should be a taz/ directory, if none we log and add it also to the cooklist.
pankso@511 69 All package are cooked with 'script', log for cooked packages are stored in
pankso@511 70 $LOG_DIR and a link exist for the web interface so developers can easily check
pankso@511 71 the bug.
pankso@511 72 </p>
pankso@511 73 <p>
pankso@511 74 When run with the option 'cook' Tazbb will also remove oold and corrupted packages,
pankso@511 75 and then execute 'tazwok genlist --text' to rebuild all packages lists. To work
pankso@511 76 properly Tazwok and Tazbb configured paths must match. Tazbb system wide configuration
pankso@511 77 file is: <code>/etc/slitaz/tazbb.conf</code>
pankso@511 78 </p>
pankso@511 79
pankso@511 80 <a name="cmds"></a>
pankso@511 81 <h3>Commands</h3>
pankso@511 82 <p>
pankso@511 83 Tazbb can be installed on your machine and be run manualy from the command
pankso@511 84 line, just type 'tazbb usage' for a list of available functions. Tazbb can be
pankso@511 85 run in report mode and display more information with the '--verbose' option.
pankso@511 86 </p>
pankso@511 87
pankso@511 88 <a name="woks"></a>
pankso@511 89 <h3>Hg and chroot Wok</h3>
pankso@511 90 <p>
pankso@511 91 Tazbb use 2 wok: a clean Hg wok and a wok to build package in a chroot.
pankso@511 92 Each time Tazbb is called, the Hg wok is updated and copied to the build
pankso@511 93 wok so we avoid messing with build results and we can also modify manually
pankso@511 94 receipts or patches directly with affecting the main Hg. If configured
pankso@511 95 correctly 'tazdev update-wok' can also update the Hg wok and copy files.
pankso@511 96 </p>
pankso@511 97
pankso@511 98 <a name="log"></a>
pankso@511 99 <h3>Log files</h3>
pankso@511 100 <p>
pankso@511 101 Tazbb use existing tool such as tazwok to build package but generate it own
pankso@511 102 log files and have it own database stored in text file. The log files are
pankso@511 103 available throught the web interface and the default path for the files is
pankso@511 104 naturally: <code>/var/log/tazbb</code>
pankso@511 105 </p>
pankso@511 106
pankso@511 107 <a name="web"></a>
pankso@511 108 <h3>Web interface</h3>
pankso@511 109 <p>
pankso@511 110 Tazbb log's all his activity to log files and cooklist, these informations
pankso@511 111 can be displayed throught a nice web interface so developers can have a quick
pankso@511 112 overview of the last build results. Tazbb package provide a PHP web interface,
pankso@511 113 CSS style and images installed by default in <code>/var/lib/tazbb/web</code>,
pankso@511 114 a symlink is created in <code>/var/www/vhosts</code> by the package, it provide
pankso@511 115 easy access to the generated log files through a virtual host or you can use:
pankso@511 116 http://localhost/vhosts/bb
pankso@511 117 </p>
pankso@511 118
pankso@511 119 <a name="hg-hook"></a>
pankso@511 120 <h3>Hg hook</h3>
pankso@511 121 <p>
pankso@511 122 Mercurial offers a powerful mechanism to perform automated actions in response
pankso@511 123 to events that occur in a repository. The name Mercurial uses for one of these
pankso@511 124 actions is a hook. So Tazbb can be run each time a commit is done in the wok
pankso@511 125 throught a simple hook in the .hgrc file of the repository. Example :
pankso@511 126 </p>
pankso@511 127 <pre class="script">
pankso@511 128 [hooks]
pankso@511 129 commit = tazbb cook-commit
pankso@511 130 </pre>
pankso@511 131
pankso@511 132 <a name="cron"></a>
pankso@511 133 <h3>Cron Job</h3>
pankso@511 134 <p>
pankso@511 135 Tazbb can be run by a cron tab, so each new commit in the wok will cook the
pankso@511 136 correct package ech time you want, cron can also be used to refresh the report
pankso@511 137 or run a full cook. If the last cook is not yet finished or if tazbb has been
pankso@511 138 run by hand and is still running, it will exit due to a lock file in /var/lock.
pankso@511 139 Example of cron job's to cook commit each 2 hour and cook all missing, modified
pankso@511 140 or unbuilt packages each night :
pankso@511 141 </p>
pankso@511 142 <pre class="script">
pankso@511 143 */2 * * * * /usr/bin/tazbb cook-commit
pankso@511 144 03 02 * * * /usr/bin/tazbb cook-all
pankso@511 145 </pre>
pankso@511 146
pankso@511 147 <a name="db"></a>
pankso@511 148 <h3>Database Files</h3>
pankso@511 149 <ul>
pankso@511 150 <li>blocked : List of blocked packages</li>
pankso@511 151 <li>cooklist : Current or next cooklist</li>
pankso@511 152 <li>corrupted : Corrupted packages list</li>
pankso@511 153 <li>packaged : All packages from the build wok</li>
pankso@511 154 <li>removed : Last removed packages</li>
pankso@511 155 <li>report : Last report from check_{wok,commit}</li>
pankso@511 156 <li>running : Current task running</li>
pankso@511 157 <li>summary : Last summary for the web interface</li>
pankso@511 158 <li>unbuilt : List of unbuilt packages</li>
pankso@511 159 </ul>
pankso@511 160
pankso@511 161 <!-- End of content -->
pankso@511 162 </div>
pankso@511 163
pankso@511 164 <!-- Footer. -->
pankso@511 165 <div id="footer">
pankso@511 166 <div class="footer-right"></div>
pankso@511 167 <a href="#top">Top of the page</a> |
pankso@511 168 <a href="index.html">Table of contents</a>
pankso@511 169 </div>
pankso@511 170
pankso@511 171 <div id="copy">
pankso@511 172 Copyright &copy; 2009 <a href="http://www.slitaz.org/en/">SliTaz</a> -
pankso@511 173 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
pankso@511 174 Documentation is under
pankso@511 175 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
pankso@511 176 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
pankso@511 177 </div>
pankso@511 178
pankso@511 179 </body>
pankso@511 180 </html>