如何复制DIR在Groovy中
以下是我的管道代码:
dir(my_directory) {
retry(1) {
// something
}
}
是否有可能通过管道上下文访问Groovy中的 dir ?
我在考虑下面这样的事情
class StepExecutor {
// some code
void dir(String directory, Closure statement) {
this.steps.dir(directory) { statement }
}
}
Below is my pipeline code :
dir(my_directory) {
retry(1) {
// something
}
}
Is there a possibility to access dir step in groovy through the pipeline context ?
I'm thinking of something like this below
class StepExecutor {
// some code
void dir(String directory, Closure statement) {
this.steps.dir(directory) { statement }
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你可以。不过,它要求您通过管道的步骤对象。
从管道内部创建对象:
Yes you can. It requires you to pass the steps-object of the pipeline though.
creating the object from inside of your pipeline: