-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathindex.jelly
96 lines (87 loc) · 4.72 KB
/
index.jelly
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
<!--
The MIT License (MIT)
Copyright (c) 2015, CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:s="/lib/form">
<l:layout title="${%Disk usage}" permission="${app.ADMINISTER}">
<l:breadcrumb title="${%Disk usage}" href="."/>
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>${%Disk usage}</h1>
<st:include page="message.jelly" />
<l:tabBar>
<l:tab name="${%Jobs}" active="true" href="."/>
<l:tab name="${%Directories}" href="./directories"/>
</l:tabBar>
<table class="sortable pane bigtable">
<thead>
<tr>
<th class="pane-header" initialSortDir="down">${%Item name}</th>
<th class="pane-header" style="text-align: right">${%Disk usage} (kB)</th>
<th class="pane-header" style="text-align: right">${%Action}</th>
</tr>
</thead>
<tbody>
<j:forEach var="e" items="${it.jobsUsages}">
<j:if test="${e.usage != 0}">
<tr>
<td class="pane">
<a href="${rootURL}/${e.url}" class="model-link inside">${e.displayName}</a>
</td>
<td class="pane" style="text-align: right">
<j:choose>
<j:when test="${e.usage > 0}">${e.usage}</j:when>
<j:otherwise>N/A</j:otherwise>
</j:choose>
</td>
<td class="pane" style="text-align: right">
<s:link href="clean/?job=${e.fullName}" post="true">run cleanup</s:link>
</td>
</tr>
</j:if>
</j:forEach>
</tbody>
</table>
<div style="padding:10px; margin-top: 10px; border: solid 1px #000; background: #cfc">
<h4>Background</h4>
<p>
Large amounts of disk are typically consumed by a job's build history as each entry in the build history will have an archived
copy of the build artifacts.
</p>
<p>
e.g. A 100MB WAR file is archived and 30 builds are retained in the build history - this will result in 3GB of
usage for a single Jenkins job. By default builds are retained forever - thus the storage requirement for Jenkins master is unbounded.
</p>
<h4>Limiting Disk Usage</h4>
<p>
Jobs can be configured with "<em>Discard Old Builds</em>" option to only keep X builds in history
(or to only keep them for a maximum of N days).
</p>
<p>
A better option is to open the <em>Advanced</em> section for the "<em>Discard Old Builds</em>" option
and to configure "<em>Max # of builds to keep with artifacts</em>".
</p>
<p>
The 'run cleanup' link in the above job list will instruct
Jenkins to cleanup the build history as per the configuration.
</p>
</div>
</l:main-panel>
</l:layout>
</j:jelly>