aboutsummaryrefslogtreecommitdiffstats
path: root/Report/Box/ignore_05_CauldronISOBuild.php
blob: 254dcfbcac3fea99f6b65da24441fb4401ccd748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
/**
 * Cauldron ISO build service reporting box.
 *
 * Not working yet, mostly a mockup so far.
 *
 * PHP version 5
 *
 * @category Dashboard
 * @package  Buildsystem
 * @author   Romain d'Alverny <rda@mageia.org>
 * @license  MIT License, see LICENSE.txt
 * @link     http://svnweb.mageia.org/svn/soft/dashboard/
*/

/**
*/
class Report_Box_CauldronISOBuild extends Report_Box
{
    /**
    */
    var $title = "Cauldron ISO Build/QA/Pub";
    
    /**
    */
    function _get_var_definitions() {
        return array(
        );
    }
    
    /**
    */
    function _get_links()
    {
        return 'View <a href="http://bcd.mageia.org/">bcd site</a>';
    }

    function render()
    {
        $obj = array(
            array(
                'ts' => gmdate('c'),
                'type' => 'info',
                'value' => 'Built packages tree is not ready &ndash; no build planned.'
            ),
            array(
                'ts' => gmdate('c') - 5,
                'type' => 'info',
                'value' => 'Next build 1a1 should start in about 12 hours (at 2011-03-15 20:23:33), with a <a href="">new context</a>.'
            ),
            array(
                'ts' => gmdate('c') - 10,
                'type' => 'report',
                'build' => '1a0',
                'contextDiffLink' => '',
                'started_at' => '2011-03-14 23:03:15',
                'products' => array(
                    array(
                        'name' => 'DVD i586',
                        'build' => array(true, 'url'),
                        'tests' => array(false, 'url'),
                        'iso' => 'cauldron-2-dvd-i586-1a0-qafail.iso'
                    ),
                    array(
                        'name' => 'DVD x86_64',
                        'build' => array(true, 'url'),
                        'tests' => array(true, 'url'),
                        'iso' => 'cauldron-2-dvd-i586-1a0-qapass.iso'
                    ),
                    array(
                        'name' => 'CD dual',
                        'build' => array(false, 'url'),
                        'tests' => null,
                        'iso' => null
                    ),
                    array(
                        'name' => 'netinstall',
                        'build' => 'pending'
                    )
                )
            )
        );
        $values = array();
        foreach ($obj as $item)
        {
            if ($item['type'] == 'info') {
                $values[] = array(
                    't' => sprintf('<p>%s</p>', $item['value']),
                    'c' => null
                );
            }
            elseif ($item['type'] == 'report') {
                $lis = '';
                foreach ($item['products'] as $p) {
                    $st = $item['build'][0] ? 'ok' : 'failed';
                    $lis .= <<<T
<li>{$p['name']},
    <span class="{$st}">build {$st}</span> (<a href="">log</a>),
    <span class="{$st}">tests {$st}</span> (<a href="">log</a>),
    <a href="">{$p['iso']}</a></li>
T;
                }
                $text = <<<T
<h4>Build {$item['build']}
    <span style="font-weight: normal;">(<a href="">context diff w/ build {$item['prev_build']}</a>)</span>
    &ndash; {$item['ts']}</h4>
<ul>{$lis}</ul>
T;
                $values[] = array(
                    't' => $text,
                    'c' => null
                );
            }
        }

        return array(
            'title'  => $this->title,
            'status' => 0,
            'values' => $values,
            'links'  => $links
        );
    }
/*
                <li>DVD i586,
                    <span class="ok">build ok</span> (<a href="">log</a>),
                    <span class="failed">tests failed</span> (<a href="">log</a>),
                    <a href="">cauldron-2-dvd-i586-1a0-qafail.iso</a></li>
                <li>DVD x86_64,
                    <span class="ok">build ok</span> (<a href="">log</a>),
                    <span class="ok">tests ok</span> (<a href="">log</a>),
                    <a href="">cauldron-2-dvd-i586-1a0-ok.iso</a></li>
                <li>CD dual,
                    <span class="failed">build failed</span> (<a href="">log</a>)</li>
                <li>building netinstall image...</li>
            </ul>
        <li><h4>Build 199
            <span style="font-weight: normal;">(<a href="">context diff w/ build 198</a>)</span>
            &ndash; 2011-03-12 23:03:15</h4>
            <table border="1" class="isobuild">
            <tbody>
                <tr>
                    <th>Item</th>
                    <th>Build</th>
                    <th>Tests</th>
                    <th>Download</th>
                </tr>
                <tr>
                    <td>DVD i586</td>
                    <td><span class="ok">OK</span> (<a href="">log</a>)</td>
                    <td><span class="ok">OK</span> (<a href="">log</a>)</td>
                    <td><a href="">cauldron-2-1a0-dvd-i586-ok.iso</a></td>
                </tr>
                <tr>
                    <td>DVD x86_64</td>
                    <td><span class="ok">OK</span> (<a href="">log</a>)</td>
                    <td><span class="failed">FAILED</span> (<a href="">log</a>)</td>
                    <td><a href="">cauldron-2-1a0-dvd-x86_64-qafail.iso</a></td>
                </tr>
                <tr>
                    <td>CD dual</td>
                    <td><span class="failed">FAILED</span> (<a href="">log</a>)</td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td>netinstall</td>
                    <td><span class="ok">OK</span> (<a href="">log</a>)</td>
                    <td><span class="ok">OK</span> (<a href="">log</a>)</td>
                    <td><a href="">cauldron-2-1a0-netinstall-ok.iso</td>
                </tr>
            </tbody>
            </table>

        </li>
    </ul>
*/
}