summaryrefslogtreecommitdiffstats
path: root/dmt/html/services.html
blob: ae4dee6dbfe69e85945671433fea0b91d05d505e (plain) (blame)
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
<h1>Services</h1>

% show() {
%   $gitcmd show --quiet --format="$1" HEAD | escape_html
% }

% describe() {
%   $gitcmd describe --all --exact-match "$1" 2>/dev/null | escape_html
% }

% for serv in $CYCHE_SERVICE_DIR/*; do
%   gitcmd="git --git-dir=$serv/.git"
%   url=$($gitcmd remote get-url origin | escape_html)
%   previous_hash=$(cat $serv/.git/previous_hash)
%   current_hash=$(show '%H')
%   [ "$current_hash" == "$previous_hash" ] && class="" || class="standout"

    <div class="box %($class%)">
        <div class="box-title">
            %{ basename $serv %}
            <span class="right"><a href="%($url%)">%($url%)</a></span>
        </div>

        <div class="box-text">
            <table>
                <tr>
                    <td>Deployed:</td>
                    <td>%($previous_hash%)</td>
                    <td>%{describe $previous_hash%}</td>
                </tr>
                <tr>
                    <td>Commit:</td>
                    <td>%($current_hash%)</td>
                    <td>%{describe $current_hash%}</td>
                </tr>
                <tr>
                    <td>Committer:</td>
                    <td>%{show '%cn <%ce>'%}</td>
                    <td>%{show '%cD'%}</td>
                </tr>
                <tr>
                    <td>Tree:</td>
                    <td>%{show '%T'%}</td>
                </tr>
            </table>
        </div>
    </div>

% done