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