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

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