文件不在jenkins服务器的从机中不存储 [英] File not unstash in slave machine of jenkins server
问题描述
我使用ubundu作为jenkins服务器的主机,并将windows机器配置为从机。我试图把一个文件从主从存储到主存储中,但它并不是未分离的。
I used the ubundu as a master machine of jenkins server and configured windows machine as the slave. I tried to stash and unstash a file from master to slave's worksapce but it is not unstashed.
node('slave') {
node('master'){
stash includes: "file.tgz" name: "master-stash"
}
unstash "master-stash"
bat "ls"
}
输出:
[Pipeline] node
Running on master in /var/lib/jenkins/workspace/testing
[Pipeline] {
[Pipeline] stash
Stashed 1 file(s)
[Pipeline] }
[Pipeline] // node
[Pipeline] unstash
该文件可以从主设备保存,但不会在从设备的工作区中不分离。
The file can be stashed from the master, but it is not unstashed in the slave's workspace.
jenkins:2.35
jenkins: 2.35
推荐答案
通过在存储器中添加根文件夹包括。我不知道为什么它没有去掉一个文件,但它可以用文件去除根文件夹。
I resolved the stash ans unstash problem by adding root folder in the stash includes. I don't know why it is not unstash a single file, but it can unstash a root folder with file.
node('slave') {
node('master'){
stash includes: "rootFolder/file.tgz" name: "master-stash"
}
unstash "master-stash"
bat "ls"
}
来自当前工作区的rootFolder / file.tgz。
The unstash file can be get from rootFolder/file.tgz of current workspace.
这篇关于文件不在jenkins服务器的从机中不存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!