summaryrefslogtreecommitdiff
path: root/buildmaster
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-02 10:43:58 +0200
committerErich Eckner <git@eckner.net>2018-05-02 10:43:58 +0200
commit0eceb8c7bbe0b68311e0bc296fde9b13004f96bb (patch)
treedaada1c6a51bd18ae815dc9bb800e362828e88ae /buildmaster
parent5a63a7e30c01a3343da96e222b59360a5aa37391 (diff)
downloadarchweb32-0eceb8c7bbe0b68311e0bc296fde9b13004f96bb.tar.xz
buildmaster/status.php: some more contentv20180503
Diffstat (limited to 'buildmaster')
-rw-r--r--buildmaster/status.php65
1 files changed, 43 insertions, 22 deletions
diff --git a/buildmaster/status.php b/buildmaster/status.php
index d58d379..46c2fc1 100644
--- a/buildmaster/status.php
+++ b/buildmaster/status.php
@@ -1,28 +1,49 @@
<?php
- include "lib/mysql.php";
-
- $result = mysql_run_query(
- "SELECT MAX(`package_sources`.`commit_time`) AS `last`" .
- "FROM `package_sources`"
- );
-
-?>
-<html>
- <head>
- <title>Build master status</title>
- <link rel="stylesheet" type="text/css" href="/static/style.css">
- </head>
- <body>
-<?php show_warning_on_offline_slave(); ?>
- <a href="https://buildmaster.archlinux32.org/">Start page</a><br>
-<?php
+include "lib/mysql.php";
+include "lib/style.php";
+
+$result = mysql_run_query(
+ "SELECT MAX(`package_sources`.`commit_time`) AS `last_commit`" .
+ " FROM `package_sources`"
+);
+
+if ($result -> num_rows > 0) {
+ $result = $result->fetch_assoc();
+ $last_commit = $result["last_commit"];
+}
+
+$result = mysql_run_query(
+ "SELECT MAX(`build_assignments`.`return_date`) AS `last_return`" .
+ " FROM `build_assignments`"
+);
+
+if ($result -> num_rows > 0) {
+ $result = $result->fetch_assoc();
+ $last_return = $result["last_return"];
+}
+
+$result = mysql_run_query(
+ "SELECT MAX(`binary_packages`.`last_moved`) AS `last_moved`" .
+ " FROM `binary_packages`" .
+ " JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`" .
+ " WHERE `binary_packages`.`last_moved`>`build_assignments`.`return_date`"
+);
if ($result -> num_rows > 0) {
- $row = $result->fetch_assoc();
- print " latest package source is from " . $row["last"] . ".<br>\n";
+ $result = $result->fetch_assoc();
+ $last_moved = $result["last_moved"];
}
-?>
- </body>
-</html>
+print_header("Build Master Status");
+
+if (isset($last_commit))
+ print " latest package source is from " . $last_commit . ".<br>\n";
+
+if (isset($last_return))
+ print " latest built package is from " . $last_return . ".<br>\n";
+
+if (isset($last_return))
+ print " latest package move was on " . $last_moved . ".<br>\n";
+
+print_footer("Copyright © 2018 <a href=\"mailto:arch@eckner.net\" title=\"Contact Erich Eckner\">Erich Eckner</a>.");