繁体   English   中英

需要对詹金斯代码进行一些澄清

[英]Some clarification needed on Jenkins code

def reportPath = build.getWorkspace().child("HealthTestResults.html")
msg.setContent(reportPath.readToString(), "text/html");

我知道getWorkspace(), child() , setContent()是Java方法。 我了解他们的工作,我看了看Javadoc。 但是reportPath是什么类型? 这里混合使用两种不同的语言吗?

为什么使用def定义reportPath

这是Groovy的:

https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/resources/hudson/plugins/emailext/templates/groovy-html.template

从这里: https : //wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin

脚本特别强大,因为它们提供了对Jenkins API的钩子,包括hudson.model.AbstractBuild和hudson.model.AbstractProject。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM