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

Fix fa2c5bed2417, en: localy browseable (with file://)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Oct 26 09:50:23 2009 +0100 (2009-10-26)
parents 489aa5f8f2f0
children 0e0bc81a63ee
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>
paul@518 21 <a href="boot-scripts.html">Boot scripts</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>
paul@517 34 The goal of Tazbb is to automate, test and report packages built inside a wok.
paul@517 35 Run <code>tazbb usage</code> for the list of available commands with
paul@517 36 a short description.
paul@517 37 The Status of the Tank Build Bot via a Tazbb web interface is at
paul@518 38 <a href="http://bb.slitaz.org/">bb.slitaz.org</a> and for collaboration,
paul@518 39 use the <a href="http://labs.slitaz.org/wiki/distro/Tazbb">Tazbb Wiki</a>.
pankso@511 40 </p>
pankso@511 41
pankso@511 42 <ul>
pascal@550 43 <li><a href="build-bot.html#about">How it works</a></li>
pascal@550 44 <li><a href="build-bot.html#cmds">Commands</a></li>
pascal@550 45 <li><a href="build-bot.html#woks">Hg and chroot Wok</a></li>
pascal@550 46 <li><a href="build-bot.html#log">Log files</a></li>
pascal@550 47 <li><a href="build-bot.html#web">Web interface</a></li>
pascal@550 48 <li><a href="build-bot.html#hg-hook">Hg hook</a></li>
pascal@550 49 <li><a href="build-bot.html#cron">Cron Job</a></li>
pascal@550 50 <li><a href="build-bot.html#db">Database Files</a></li>
pankso@511 51 </ul>
pankso@511 52
pankso@511 53 <a name="about"></a>
pankso@511 54 <h3>How it works</h3>
pankso@511 55 <p>
paul@517 56 Tazbb can be run by a cron job and checks the last commit done by contributors
paul@517 57 and then cooks the modified packages. Runnning 'tazbb cook-commit' will just
paul@517 58 rebuild the last modified packages. To rebuild all missing, modified or unbuilt
paul@517 59 packages you must use the 'tazbb cook-all' command.
pankso@511 60 </p>
pankso@511 61 <p>
paul@517 62 Generating a report will source all the receipts in the wok and check if a package
paul@517 63 file exists, if not we add the package name to the current cooklist. For
paul@517 64 existing packages we compare all the files' dates in the Hg wok (receipt, stuff)
paul@540 65 against the package.tazpkg file date, if it differs we add the package to the cooklist.
pankso@511 66 </p>
pankso@511 67 <p>
paul@517 68 Tazbb must also look in the chroot wok to check if the package is already built, (there
paul@517 69 should be a taz/ directory), if not we log it and add it also to the cooklist.
paul@517 70 All packages are cooked with a 'script'. Logs for cooked packages are stored in
paul@517 71 $LOG_DIR and a link exists for the web interface so that developers can easily check
paul@517 72 for bugs.
pankso@511 73 </p>
pankso@511 74 <p>
paul@517 75 When run with the option 'cook' - Tazbb will also remove old and corrupted packages
paul@517 76 and then execute 'tazwok genlist --text' to rebuild all the packages lists. To work
paul@517 77 properly, the Tazwok and Tazbb configured paths must match. The Tazbb system wide
paul@517 78 configuration file is: <code>/etc/slitaz/tazbb.conf</code>
pankso@511 79 </p>
pankso@511 80
pankso@511 81 <a name="cmds"></a>
pankso@511 82 <h3>Commands</h3>
pankso@511 83 <p>
paul@517 84 Tazbb can be installed on your machine and run manually from the command
paul@517 85 line - just type 'tazbb usage' for a list of available functions. Tazbb can be
paul@517 86 run in report mode and made to display more information with the '--verbose' option.
pankso@511 87 </p>
pankso@511 88
pankso@511 89 <a name="woks"></a>
pankso@511 90 <h3>Hg and chroot Wok</h3>
pankso@511 91 <p>
paul@517 92 Tazbb uses 2 woks: a clean Hg wok and a wok to build packages in a chroot environment.
paul@517 93 Each time Tazbb is called; the Hg wok is updated and copied to the build
paul@517 94 wok, so we avoid messing with build results and can also manually modify
paul@517 95 receipts or patches directly without affecting the main Hg. If configured
pankso@511 96 correctly 'tazdev update-wok' can also update the Hg wok and copy files.
pankso@511 97 </p>
pankso@511 98
pankso@511 99 <a name="log"></a>
pankso@511 100 <h3>Log files</h3>
pankso@511 101 <p>
paul@517 102 Tazbb uses existing tools such as tazwok to build packages, but generates its own
paul@517 103 log files and has its own database stored in a text file. The log files are
paul@517 104 available through the web interface and the default path for the files is:
paul@517 105 <code>/var/log/tazbb</code>
pankso@511 106 </p>
pankso@511 107
pankso@511 108 <a name="web"></a>
pankso@511 109 <h3>Web interface</h3>
pankso@511 110 <p>
paul@517 111 Tazbb logs all its activity to log files and a cooklist. This information
paul@517 112 can be displayed through a nice web interface so developers can have a quick
paul@517 113 overview of the last build results. The Tazbb package provides a PHP web interface,
paul@517 114 CSS stylesheets and images installed by default in <code>/var/lib/tazbb/web</code>.
paul@517 115 A symlink is created in <code>/var/www/vhosts</code> by a package, it provides
pankso@511 116 easy access to the generated log files through a virtual host or you can use:
pankso@511 117 http://localhost/vhosts/bb
pankso@511 118 </p>
pankso@511 119
pankso@511 120 <a name="hg-hook"></a>
pankso@511 121 <h3>Hg hook</h3>
pankso@511 122 <p>
pankso@511 123 Mercurial offers a powerful mechanism to perform automated actions in response
pankso@511 124 to events that occur in a repository. The name Mercurial uses for one of these
pankso@511 125 actions is a hook. So Tazbb can be run each time a commit is done in the wok
paul@517 126 through a simple hook in the .hgrc file of the repository. Example:
pankso@511 127 </p>
pankso@511 128 <pre class="script">
pankso@511 129 [hooks]
pankso@511 130 commit = tazbb cook-commit
pankso@511 131 </pre>
pankso@511 132
pankso@511 133 <a name="cron"></a>
pankso@511 134 <h3>Cron Job</h3>
pankso@511 135 <p>
paul@517 136 Tazbb can also be run by a cron tab, so each new commit in the wok will cook the
paul@517 137 correct package each time you want. Cron can also be used to refresh the report
pankso@511 138 or run a full cook. If the last cook is not yet finished or if tazbb has been
paul@517 139 run by hand (and is still running), it will exit due to a lock file in /var/lock.
paul@517 140 Example of a cron job to 'tazbb cook commit' every 2 hours and cook all missing, modified
paul@517 141 or unbuilt packages each night:
pankso@511 142 </p>
pankso@511 143 <pre class="script">
pankso@511 144 */2 * * * * /usr/bin/tazbb cook-commit
pankso@511 145 03 02 * * * /usr/bin/tazbb cook-all
pankso@511 146 </pre>
pankso@511 147
pankso@511 148 <a name="db"></a>
pankso@511 149 <h3>Database Files</h3>
pankso@511 150 <ul>
pankso@511 151 <li>blocked : List of blocked packages</li>
pankso@511 152 <li>cooklist : Current or next cooklist</li>
pankso@511 153 <li>corrupted : Corrupted packages list</li>
pankso@511 154 <li>packaged : All packages from the build wok</li>
pankso@511 155 <li>removed : Last removed packages</li>
pankso@511 156 <li>report : Last report from check_{wok,commit}</li>
pankso@511 157 <li>running : Current task running</li>
pankso@511 158 <li>summary : Last summary for the web interface</li>
pankso@511 159 <li>unbuilt : List of unbuilt packages</li>
pankso@511 160 </ul>
pankso@511 161
pankso@511 162 <!-- End of content -->
pankso@511 163 </div>
pankso@511 164
pankso@511 165 <!-- Footer. -->
pankso@511 166 <div id="footer">
pankso@511 167 <div class="footer-right"></div>
pascal@550 168 <a href="build-bot.html#top">Top of the page</a> |
pankso@511 169 <a href="index.html">Table of contents</a>
pankso@511 170 </div>
pankso@511 171
pankso@511 172 <div id="copy">
pankso@511 173 Copyright &copy; 2009 <a href="http://www.slitaz.org/en/">SliTaz</a> -
pankso@511 174 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
pankso@511 175 Documentation is under
pankso@511 176 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
pankso@511 177 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
pankso@511 178 </div>
pankso@511 179
pankso@511 180 </body>
pankso@511 181 </html>