aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-11-01 21:00:03 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-11-01 21:00:03 +0100
commit3461ec9baafd384a540041121ed6fb913e020245 (patch)
tree5a1882a1d7edeaa4a05482b7098bf66c0ec799be /web
parent62a02d770cb59b13195aacc7e48f59094008b1d4 (diff)
downloadbuildroot-test-3461ec9baafd384a540041121ed6fb913e020245.tar.gz
buildroot-test-3461ec9baafd384a540041121ed6fb913e020245.tar.bz2
import.inc.php: parse a "branch" file in the build results
This is the first step towards building multiple branches in the autobuilders. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'web')
-rw-r--r--web/import.inc.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/web/import.inc.php b/web/import.inc.php
index 8b15c85..28d4b0a 100644
--- a/web/import.inc.php
+++ b/web/import.inc.php
@@ -188,6 +188,14 @@ function import_result($buildid, $filename)
$status_stat = stat($thisbuildfinaldir . "status");
$builddate = strftime("%Y-%m-%d %H:%M:%S", $status_stat['mtime']);
+ /* Get the branch */
+ $branch_file = $thisbuildfinaldir . "branch";
+ if (file_exists($branch_file)) {
+ $branch = file_get_contents($branch_file);
+ } else {
+ $branch = "master";
+ }
+
/* Get submitter, commitid, duration */
$submitter = trim(file_get_contents($thisbuildfinaldir . "submitter", "r"));
$commitid = trim(file_get_contents($thisbuildfinaldir . "gitid", "r"));
@@ -233,7 +241,7 @@ function import_result($buildid, $filename)
$db = new db();
/* Insert into the database */
- $sql = "insert into results (status, builddate, submitter, commitid, identifier, arch, reason, libc, static, subarch, duration) values (" .
+ $sql = "insert into results (status, builddate, submitter, commitid, identifier, arch, reason, libc, static, subarch, duration, branch) values (" .
$db->quote_smart($status) . "," .
$db->quote_smart($builddate) . "," .
$db->quote_smart($submitter) . "," .
@@ -244,7 +252,8 @@ function import_result($buildid, $filename)
$db->quote_smart($found_libc) . "," .
$db->quote_smart($static) . "," .
$db->quote_smart($subarch) . "," .
- $db->quote_smart($duration) .
+ $db->quote_smart($duration) . "," .
+ $db->quote_smart($branch) .
")";
$ret = $db->query($sql);