[英]Check if file path exists in a different node jenkins?
Lets say I have 2 nodes:假设我有 2 个节点:
I want to check if NodeB has a given directory through NodeA.我想通过 NodeA 检查 NodeB 是否有给定的目录。 Is there a way to do this through the Jenkins API?有没有办法通过 Jenkins API 做到这一点?
Expected Results预期成绩
You can probably do something like this.你可能可以做这样的事情。
def isDirAvailable() {
def isAvailble = false;
node('NodeA') {
if(fileExists("/Path/to/dir")){
isAvailble = true;
}
}
return isAvailble;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.