tazwok view web/index.php @ rev 363

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