<% def dateFormat = new java.text.SimpleDateFormat("yyyy-M-d H:m:s") %>

${pipeline.documentation.title}

Created by Bpipe, ${new Date()}


Result


<%if(pipeline.failed) {%> Failed in stage <%=stages.flatten().reverse().find { list -> list.find {!it.succeeded} }?.context?.stageName%> <%} else {%> Succeeded <%}%>

Timeline


<%stages.each { branch -> %>
<%long totalTimeMs = branch*.context*.documentation.grep{it != null}.sum{ it.elapsedMs?:0 }; int count=0; int branchCount=0;%> <%def widths=[] %> <%branch.each { stage -> def ctx = stage.context; def width = (ctx.documentation.elapsedMs?:0)/(float)totalTimeMs*100; if(width<5.0) width=5.0f widths << width; } // width can be greater than 100%, so scale here: def total = widths.sum() widths = widths.collect { it / (total/100.0f) } // Make sure the last width is right aligned if(widths) widths[-1] += 100.0f - widths.sum() + 1.0f %> <% float left = 0; branch.each { stage -> def ctx = stage.context; branchCount++; %>
class='timeblock <%if(!stage.succeeded){%>failed<%}%> <%=(branch && stage==branch[-1])?"right":""%>' style='left: ${left}%; width: ${width-1}%'> <% // Just a heuristic here, we roughly assume 1% width per char (for 1024px, 10px char width) // So truncate when text is wider than that. The -1 nudges it down for the extreme case // so that the minimum 5% only gets 4 characters before truncation %> <%=bpipe.Utils.truncnl(ctx.stageName,(int)(width-1))%>
<% left += width %>
<%}%>
<%count = 0 %> <%left = 0 %> <%branch*.context.each { stage -> %>
class='timeblock duration' style='left: ${left}%; width: ${width-1}%'> <%if(stage.documentation?.finishedAt) {%> <% use(groovy.time.TimeCategory) { %> <%=(stage.documentation.finishedAt - stage.documentation.startedAt).toString().replaceAll('seconds','s').replaceAll('minutes','mins')%> <% } %> <% } %>
<% left += width %>
<%}%>
<%}%>

Pipeline Stages


<% int branchCount = 0; %> <%stages.each { branch -> ++branchCount; %>
    <%if(stages.size()>1) {%>

    Branch ${branchCount}

    <%}%> <%branch.each { stage -> def ctx = stage.context; %>
  1. <% if(ctx.documentation?.title) { %> ${ctx.stageName} : ${ctx.documentation.title} <%} else {%> ${ctx.stageName} <% } %> <%if(stage.succeeded) {%> ✓ <%} else {%> X <%}%>

    <%if(ctx.documentation) {%> <% def doc = ctx.documentation; %> <%if(doc.desc) {%>

    ${doc.desc}

    <%}%> <%if(doc.author) {%> <%}%> <%if(doc.inputs || ctx.inputs) {%> <%if(ctx.inputs) {%> <%} else {%> <% if(doc.inputs instanceof List) { %> <% } %> <% } %> <%}%> <%if(doc.outputs || ctx.outputs) {%> <% if(ctx.outputs) { %> <% } else { %> <% if(doc.outputs instanceof List) { %> <% } else { %> <% } %> <% } %> <%}%> <%if(doc.tools) {%> <%}%> <%if(doc?.constraints) {%> <%}%> <%if(doc.startedAt) {%> <%}%>
    Author ${doc.author}
    Inputs
      <% ctx.inputs.each { inp -> %>
    • ${inp.replaceAll("^\\./","")}
    • <% } %>
      <% doc.inputs.each { inp -> %>
    • ${inp}
    • <% } %>
    <% } else { %>
    ${doc.inputs}
    Commands${ctx.trackedOutputs.keySet().join("
    ")}
    Outputs
      <%ctx.outputs.each { output ->%>
    • ${output.replaceAll("^\\./","")}
    • <%}%>
      <% doc.outputs.each { inp -> %>
    • ${inp}
    • <% } %>
    ${doc.outputs}
    Tools
      <% doc.tools.each { name, detail -> %>
    • <% if(detail.meta.link) { %> ${name} <% } else { %> ${name} <% } %> : ${detail.version} <% if(detail.meta.desc) { %> - ${detail.meta.desc} <% } %>
    • <% } %>
    Constraints ${doc.constraints}
    Execution Time <%if(doc.elapsedMs<1000 || !doc.finishedAt) { %> ${dateFormat.format(doc.startedAt)} <% } else {%> ${dateFormat.format(doc.startedAt)} - ${dateFormat.format(doc.finishedAt)} <% } %> <%if(doc.finishedAt) use(groovy.time.TimeCategory) { %> (${doc.finishedAt - doc.startedAt}) <% } %>
    <%}%>
  2. <%}%>
<%}%>