website view en/doc/cookbook/build-bot.html @ rev 514

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