tazwok view web/index.php @ rev 334

Last commit here: tazwok is no more experimental
author Antoine Bodin <gokhlayeh@slitaz.org>
date Tue Feb 22 01:56:15 2011 +0100 (2011-02-22)
parents 3271becd1c47
children e61948e8d2a3
line source
3 <?php
4 $version=$_GET["version"];
5 if (file_exists("conf-$version.php")) {
6 include("conf-$version.php");
7 }
8 else {
9 if (file_exists("conf.php")) {
10 include("conf.php");
11 }
12 }
14 function include_and_link($file)
15 {
16 global $log_dir, $version;
17 if (($fp = fopen($file,"r")) === false) return;
18 while (($pkg = fgets($fp)) !== false) {
19 $pkg = chop($pkg);
20 if (file_exists("$log_dir/$pkg.html"))
21 echo "<a href=\"log.php?version=$version&package=$pkg\">$pkg</a>\n";
22 else echo "$pkg\n";
23 }
24 fclose($fp);
25 }
27 function list_last_cooked($dir, $suffix)
28 {
29 global $version;
30 $path=basename($dir);
31 system("cd $dir && ls -1t *.$suffix | head -20 | \
32 while read file; do echo -n \$(stat -c '%y' $dir/\$file | \
33 cut -d. -f1); echo ' <a href=\"download.php?version=$version&package=$path/'\$file'\">'\$file'</a>'; done");
34 }
36 ?>
37 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
38 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
39 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
40 <head>
41 <title>SliTaz Build Bot</title>
42 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
43 <meta name="description" content="Tazbb web interface" />
44 <meta name="robots" content="index nofollow" />
45 <link rel="shortcut icon" href="web/favicon.ico" />
46 <link rel="stylesheet" type="text/css" href="web/slitaz.css" />
47 </head>
48 <body>
50 <!-- Header -->
51 <div id="header">
52 <!-- Access -->
53 <div id="access">
54 <?php
55 $versions_list = fopen('repositories.list', 'r');
56 if($versions_list)
57 {
58 $otherversion = '';
59 while(!feof($versions_list))
60 {
61 $otherversion = fgets($versions_list);
62 echo "<a href=\"?version=$otherversion\">$otherversion</a>";
63 }
64 fclose($versions_list);
65 }
66 ?>
67 </div>
68 <a href="http://bb.slitaz.org/"><img id="logo"
69 src="web/logo.png"
70 title="bb.slitaz.org" alt="bb.slitaz.org" /></a>
71 <p id="titre">#!/Build/Bot/<?php echo $version; ?></p>
72 </div>
74 <!-- Content -->
75 <div id="content-full">
77 <!-- Block begin -->
78 <div class="block">
79 <!-- Nav block begin -->
80 <div id="block_nav">
81 <h3><img src="pics/website/development.png" alt="" />Developers</h3>
82 <ul>
83 <li><a href="http://www.slitaz.org/en/devel/">Website/devel</a></li>
84 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
85 <li><a href="http://hg.slitaz.org/">Mercurial Repos</a></li>
86 <li><a href="http://people.slitaz.org/">People Stuff</a></li>
87 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
88 </ul>
89 <!-- Nav block end -->
90 </div>
91 <!-- Top block begin -->
92 <div id="block_top">
93 <h1>Build Bot</h1>
94 <p>
95 Tazwok is a <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
96 Build Bot, it automatically cooks and tests packages commited in
97 the wok. SliTaz <a href="http://pkgs.slitaz.org/">packages</a> are
98 cooked on the project main server: code name
99 <a href="http://tank.slitaz.org">Tank</a>. This web interface gives
100 the current status of the build bot and the last report
101 about any packages modified by the SliTaz contributors in
102 the Mercurial repositories, aka
103 <a href="http://hg.slitaz.org/">Hg repos</a>.
104 </p>
105 <!-- Top block end -->
106 </div>
107 <!-- Block end -->
108 </div>
110 <h2>Cooklog</h2>
112 <p>
113 <form action="log.php" method="get">
114 <input type="hidden" name="version" value="<?php
115 echo "$version";
116 ?>
117 " />
118 Show pkg log:<br />
119 <input type="text" name="package" />
120 <!-- <input type="submit" value="Show" /> -->
121 </form><br />
122 Note:<br />
123 Flavors/Iso build logs are named: iso-?flavor <br />
124 Temporary toolchain logs are named: tmp-toolchain-?package <br />
125 Check-incoming log is named: incoming
126 </p>
128 <h2>Summary</h2>
129 <pre class="package">
130 <?php
131 // Check curent status (update in real time) and display summary.
132 if (file_exists($lockfile)) {
133 echo "Status : Chroot is mounted\n";
134 }
135 else {
136 echo "Status : Chroot is not mounted\n";
137 }
138 include("$db_dir/summary");
139 ?>
140 </pre>
141 <ul>
142 <li>Packages in the wok: <?php
143 system("cd $wok && ls -1 | wc -l"); ?></li>
144 <li>Packages in the main repository: <?php
145 system("cd $packages && ls -1t *.tazpkg | wc -l"); ?></li>
146 <li>Packages in the incoming repository: <?php
147 system("cd $incoming && ls -1t *.tazpkg | wc -l"); ?></li>
148 <li>Commited packages: <?php
149 system("wc -l $packages/commit | cut -f 1 -d ' '"); ?></li>
150 <li>Packages to cook: <?php
151 system("wc -l $packages/cooklist | cut -f 1 -d ' '"); ?></li>
152 <li>Broken packages: <?php
153 system("wc -l $packages/broken | cut -f 1 -d ' '"); ?></li>
154 <li>Blocked packages: <?php
155 system("wc -l $packages/blocked | cut -f 1 -d ' '"); ?></li>
156 </ul>
158 <h3>Commit</h3>
159 <pre class="package">
160 <?php
161 include("$db_dir/commit");
162 ?>
163 </pre>
165 <h3>Cooklist</h3>
166 <pre class="package">
167 <?php
168 include("$db_dir/cooklist");
169 ?>
170 </pre>
172 <h3>Broken</h3>
173 <pre class="package">
174 <?php
175 include_and_link("$db_dir/broken");
176 ?>
177 </pre>
179 <h3>Blocked</h3>
180 <pre class="package">
181 <?php
182 include_and_link("$db_dir/blocked");
183 ?>
184 </pre>
186 <h3>Last cooked packages</h3>
187 <pre class="package">
188 <?php
189 list_last_cooked($incoming, "tazpkg");
190 ?>
191 </pre>
193 <h3>Last removed packages</h3>
194 <pre class="package">
195 <?php
196 include("$db_dir/removed");
197 ?>
198 </pre>
200 <h3>Last cooked flavors</h3>
201 <pre class="package">
202 <?php
203 list_last_cooked($packages, "flavor");
204 ?>
205 </pre>
207 <!-- End of content -->
208 </div>
210 <!-- Footer -->
211 <div id="footer">
212 <div class="right_box">
213 <h4>SliTaz Network</h4>
214 <ul>
215 <li><a href="http://www.slitaz.org/">Main Website</a></li>
216 <li><a href="http://doc.slitaz.org/">Documentation</a></li>
217 <li><a href="http://forum.slitaz.org/">Support Forum</a></li>
218 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
219 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
220 <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li>
221 </ul>
222 </div>
223 <h4>SliTaz Website</h4>
224 <ul>
225 <li><a href="#header">Top of the page</a></li>
226 <li>Copyright &copy; <span class="year"></span>
227 <a href="http://www.slitaz.org/">SliTaz</a></li>
228 <li><a href="http://www.slitaz.org/en/about/">About the project</a></li>
229 <li><a href="http://www.slitaz.org/netmap.php">Network Map</a></li>
230 <li>Page modified the <?php echo (date( "d M Y", getlastmod())); ?></li>
231 <li><a href="http://validator.w3.org/check?uri=referer"><img
232 src="pics/website/xhtml10.png" alt="Valid XHTML 1.0"
233 title="Code validé XHTML 1.0"
234 style="width: 80px; height: 15px; vertical-align: middle;" /></a></li>
235 </ul>
236 </div>
238 </body>
239 </html>