Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ It allows the users to view the history of their pipelines with stage informatio

![Aggregated Pipeline View](screenshots/AggregatedPipeline.png)

![Fullscreen](./screenshots/AggregatedPipeline.png?raw=true&width=625x)

Releases:

- 1.8 Added the option for showing only the last build of a pipeline
Expand All @@ -26,3 +28,4 @@ Releases:
to be displayed
- 1.0: initial release a dashboard like view that selects only
pipelines and presents the stages and the commits on each build.

4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

<groupId>com.paul8620.jenkins.plugins</groupId>
<artifactId>pipeline-aggregator-view</artifactId>
<version>1.12-SNAPSHOT</version>

<version>1.9.1-SNAPSHOT</version>

<packaging>hpi</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class PipelineAggregator extends View {

private int buildHistorySize;

private int refreshInterval;

private boolean useCondensedTables;

private boolean onlyLastBuild;
Expand All @@ -47,22 +49,35 @@ public class PipelineAggregator extends View {

private String filterRegex;

private boolean showCommitInfo;
private boolean showBuildNumber;
private boolean showBuildTime;
private boolean showBuildDuration;

@DataBoundConstructor
public PipelineAggregator(String name, String viewName) {
super(name);
this.viewName = viewName;
this.fontSize = 16;
this.buildHistorySize = 16;
this.refreshInterval = 15;
this.useCondensedTables = false;
this.onlyLastBuild = false;
this.filterRegex = null;

this.showCommitInfo = true;
this.showBuildNumber = true;
this.showBuildTime = true;
this.showBuildDuration = true;
}

protected Object readResolve() {
if (fontSize == 0)
fontSize = 16;
if (buildHistorySize == 0)
buildHistorySize = 16;
if (refreshInterval == 0)
refreshInterval = 15;
return this;
}

Expand All @@ -83,6 +98,38 @@ public boolean isUseCondensedTables() {
return useCondensedTables;
}

public boolean isShowCommitInfo() {
return showCommitInfo;
}

public void setShowCommitInfo(boolean showCommitInfo) {
this.showCommitInfo = showCommitInfo;
}

public boolean isShowBuildNumber() {
return showBuildNumber;
}

public void setShowBuildNumber(boolean showBuildNumber) {
this.showBuildNumber = showBuildNumber;
}

public boolean isShowBuildTime() {
return showBuildTime;
}

public void setShowBuildTime(boolean showBuildTime) {
this.showBuildTime = showBuildTime;
}

public boolean isShowBuildDuration() {
return showBuildDuration;
}

public void setShowBuildDuration(boolean showBuildDuration) {
this.showBuildDuration = showBuildDuration;
}

public boolean isUseScrollingCommits() {
return useScrollingCommits;
}
Expand All @@ -107,14 +154,29 @@ public String getFilterRegex() {
return filterRegex;
}

public int getRefreshInterval() {
return refreshInterval;
}

public void setRefreshInterval(int refreshInterval) {
this.refreshInterval = refreshInterval;
}

@Override
protected void submit(StaplerRequest req) throws ServletException, IOException {
JSONObject json = req.getSubmittedForm();
this.fontSize = json.getInt("fontSize");
this.buildHistorySize = json.getInt("buildHistorySize");
this.refreshInterval = json.getInt("refreshInterval");
this.useCondensedTables = json.getBoolean("useCondensedTables");
this.useScrollingCommits = json.getBoolean("useScrollingCommits");
this.onlyLastBuild = json.getBoolean("onlyLastBuild");
this.onlyLastBuild = json.getBoolean("onlyLastBuild");

this.showCommitInfo = json.getBoolean("showCommitInfo");
this.showBuildNumber = json.getBoolean("showBuildNumber");
this.showBuildTime = json.getBoolean("showBuildTime");
this.showBuildDuration = json.getBoolean("showBuildDuration");

if (json.get("useRegexFilter") != null) {
String regexToTest = req.getParameter("filterRegex");
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<f:entry title="${%Records in build history}">
<f:number name="buildHistorySize" value="${it.buildHistorySize}" />
</f:entry>
<f:entry title="${%Refresh interval}">
<f:number name="refreshInterval" value="${it.refreshInterval}" />
</f:entry>
<f:entry title="${%Use condensed tables}">
<f:checkbox name="useCondensedTables" field="useCondensedTables" />
</f:entry>
Expand All @@ -24,4 +27,18 @@
<f:checkbox name="onlyLastBuild" field="onlyLastBuild" />
</f:entry>
</f:section>
<f:section title="${%Field selection}">
<f:entry title="${%Show commit info}">
<f:checkbox name="showCommitInfo" field="showCommitInfo" />
</f:entry>
<f:entry title="${%Show build number}">
<f:checkbox name="showBuildNumber" field="showBuildNumber" />
</f:entry>
<f:entry title="${%Show build time}">
<f:checkbox name="showBuildTime" field="showBuildTime" />
</f:entry>
<f:entry title="${%Show build duration}">
<f:checkbox name="showBuildDuration" field="showBuildDuration" />
</f:entry>
</f:section>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
</style>
</head>
<body class="height100perc">
<script type="text/javascript">
var jenkinsUrl = '${rootURL}';
var refreshInterval = ${it.refreshInterval}*1000;
var nodeStatuses = [];
var buildHistorySize = ${it.buildHistorySize};
var useScrollingCommits= ${it.useScrollingCommits};
var onlyLastBuild= ${it.onlyLastBuild};
var showCommitInfo = ${it.showCommitInfo};
var showBuildNumber = ${it.showBuildNumber};
var showBuildTime = ${it.showBuildTime};
var showBuildDuration = ${it.showBuildDuration};
var rollingCommits = false;
function reload_info (interval) {
reload_jenkins_build_history('#jenkinsBuildHistory', jenkinsUrl + '/${it.url}', buildHistorySize, useScrollingCommits, onlyLastBuild, showCommitInfo, showBuildNumber, showBuildTime, showBuildDuration);
setTimeout(function(){ reload_info(interval); }, interval);
}
</script>

<a href="${rootURL}/${it.url}configure" alt="Configure view">
<div class="abs-top-right">
<span class="glyphicon glyphicon-cog"></span>
Expand All @@ -33,8 +51,22 @@
<!-- VIEW_URL/api/json -->
<table id="jenkinsBuildHistory" class="table table-striped table-bordered ${it.tableStyle}">
<thead>
<tr><th class="text-left">${%Job}</th><th>Stages</th><th>${%Commits}</th><th>${%Build}</th><th>${%Finished}</th><th>${%Duration
}</th></tr>
<tr><th class="text-left">${%Job}</th><th class="text-left">Stages</th>
<script type="text/javascript">
if(showCommitInfo) {
document.write("<th>${%Commits}</th>");
}
if(showCommitInfo) {
document.write("<th>${%Build}</th>");
}
if(showBuildTime) {
document.write("<th>${%Finished}</th>");
}
if(showBuildDuration) {
document.write("<th>${%Duration}</th>");
}
</script>
</tr>
</thead>
<tbody></tbody>
</table>
Expand All @@ -45,18 +77,7 @@
<script src="${rootURL}/plugin/pipeline-aggregator-view/lib/bootstrap.min.js"></script>
<script src="${rootURL}/plugin/pipeline-aggregator-view/js/pipeline-aggregator.js"></script>
<script type="text/javascript">
var jenkinsUrl = '${rootURL}';
var refreshInterval = 15*1000;
var nodeStatuses = [];
var buildHistorySize = ${it.buildHistorySize};
var useScrollingCommits= ${it.useScrollingCommits};
var onlyLastBuild= ${it.onlyLastBuild};
var rollingCommits = false;
function reload_info (interval) {
reload_jenkins_build_history('#jenkinsBuildHistory', jenkinsUrl + '/${it.url}', buildHistorySize, useScrollingCommits, onlyLastBuild);
setTimeout(function(){ reload_info(interval); }, interval);
}

var $$ = jQuery;
$$(document).ready(function(){
$$.ajaxSetup({ cache: false });
reload_info(refreshInterval);
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/css/pipeline-aggregator.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ a {
.btn {
font-size: 14px;
background-color: transparent;
border-radius: 3px !important;
margin: 1px 1px 1px 0 !important;
}

.btn-success {
Expand Down
19 changes: 18 additions & 1 deletion src/main/webapp/js/pipeline-aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,26 @@ function reload_jenkins_build_history(tableSelector, viewUrl, buildHistorySize,
}
stages += '</div>'


newRow = '<tr><td class="job-wrap text-left">' + bame + '</td><td class="text-left">' + stages + '</td>';
if(showCommitInfo) {
newRow += '<td>' + authors + '</td>';
}
if(showBuildNumber) {
newRow += '<td>' + val.number + '</td>';
}
if(showBuildTime) {
newRow += '<td>' + format_date(dt) + '</td>';
}
if(showBuildDuration) {
newRow += '<td>' + format_interval(val.duration) + '</td>';
}
newRow += '</tr>';
$(tableSelector + ' tbody').append(newRow);

newRow = '<tr><td class="job-wrap text-left">' + bame + '</td><td class="text-left">' + stages + '</td><td>' + authors + '</td><td>' + val.number + '</td><td>' + format_date(dt) + '</td><td>' + format_interval(val.duration) + '</td></trcla>';
newRows.push($(newRow));

});
});
// Remove all existing rows
Expand All @@ -111,4 +129,3 @@ function reload_jenkins_build_history(tableSelector, viewUrl, buildHistorySize,
});
}