Skip to content

Commit

Permalink
[JENKINS-59697] Create a tagib to display the result of the last bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
aheritier committed Oct 13, 2019
1 parent 06a90c0 commit 391adb7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,46 +120,7 @@

</f:form>

<j:if test="${it.lastBundleResult!=null &amp;&amp; it.lastBundleResult.contains('ERROR')}">
<div class="alert alert-danger" role="alert">
<strong>
<i class="fa fa-minus-circle"/>
Last upload failed!
</strong>
<p>
<pre>
<code>${it.lastBundleResult}</code>
</pre>
</p>
</div>
</j:if>
<j:if test="${it.lastBundleResult!=null &amp;&amp; it.lastBundleResult.contains('WARN')}">
<div class="alert alert-warning" role="alert">
<strong>
<i class="fa fa-exclamation-triangle"/>
Last upload skipped!
</strong>
<p>
<pre>
<code>${it.lastBundleResult}</code>
</pre>
</p>
</div>
</j:if>
<j:if
test="${it.lastBundleResult!=null &amp;&amp; !it.lastBundleResult.contains('ERROR') &amp;&amp; !it.lastBundleResult.contains('WARN')}">
<div class="alert alert-success" role="alert">
<strong>
<i class="fa fa-check-circle"/>
Last upload succeeded!
</strong>
<p>
<pre>
<code>${it.lastBundleResult}</code>
</pre>
</p>
</div>
</j:if>
<a:lastResult result="${it.lastBundleResult}"/>

</l:main-panel>
</l:layout>
Expand Down
53 changes: 53 additions & 0 deletions src/main/resources/lib/advisor/lastResult.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<st:documentation>
Check if Jenkins Health Advisor by CloudBees the server is available.
<st:attribute name="result" use="required">
The result of the previous upload.
</st:attribute>
</st:documentation>

<j:if test="${result!=null}">
<j:if test="${result!=null &amp;&amp; result.contains('ERROR')}">
<div class="alert alert-danger" role="alert">
<strong>
<i class="fa fa-minus-circle"/>
Last upload failed!
</strong>
<p>
<pre>
<code>${result}</code>
</pre>
</p>
</div>
</j:if>
<j:if test="${result!=null &amp;&amp; result.contains('WARN')}">
<div class="alert alert-warning" role="alert">
<strong>
<i class="fa fa-exclamation-triangle"/>
Last upload skipped!
</strong>
<p>
<pre>
<code>${result}</code>
</pre>
</p>
</div>
</j:if>
<j:if
test="${result!=null &amp;&amp; !result.contains('ERROR') &amp;&amp; !result.contains('WARN')}">
<div class="alert alert-success" role="alert">
<strong>
<i class="fa fa-check-circle"/>
Last upload succeeded!
</strong>
<p>
<pre>
<code>${result}</code>
</pre>
</p>
</div>
</j:if>
</j:if>

</j:jelly>

0 comments on commit 391adb7

Please sign in to comment.