Groovy 在Jenkins文件中使用makrup发布链接
我想在构建摘要页面中发布一个html表。 作为总结的一部分,我想添加可点击链接,这里是我迄今为止得到的:Groovy 在Jenkins文件中使用makrup发布链接,groovy,jenkins-pipeline,markdown,jenkins-groovy,Groovy,Jenkins Pipeline,Markdown,Jenkins Groovy,我想在构建摘要页面中发布一个html表。 作为总结的一部分,我想添加可点击链接,这里是我迄今为止得到的: import org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper import io.jenkins.blueocean.rest.impl.pipeline.PipelineNodeGraphVisitor import io.jenkins.blueocean.rest.impl.pipeline.FlowNodeW
import org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper
import io.jenkins.blueocean.rest.impl.pipeline.PipelineNodeGraphVisitor
import io.jenkins.blueocean.rest.impl.pipeline.FlowNodeWrapper
def List getBranchResults() {
def writer = new StringWriter() // html is written here by markup builder
def markup = new groovy.xml.MarkupBuilder(writer) // the builder
markup.html{
markup.table(class:"table table-bordered table-hover table-condensed") {
markup.thead{
markup.tr {
markup.th(title:"Field #1", "task name")
markup.th(title:"Field #2", "status")
markup.th(title:"Field #3", "link")
} // tr
} // thead
markup.tbody{
markup.tr{
markup.td(align:"right","Name")
markup.td(align:"right","RESULT")
markup.td(align:"right","https://www.google.com/")
} // tr
} //tbody
} // table
}
manager.createSummary("accept.png").appendText(writer.toString(), false, false, false, "green")
}
getBranchResults( )
也试过
markup.td(align:"right","<a href=https://www.google.com />")
markup.td(align:“right”,“使用markup.td(class:“center”,){delegate.a(href:“www.google,com”,“link”)}制作作业使用markup.td(class:“center”,){delegate.a(href:“www.google,com”,“link”)}制作作业