2016-10-24 36 views
0

构建工作由配置在从机(建码头工人的形象,从GitHub代码),但它不建立成功......如果主机改变工作,它成功打造


奴隶建立消息:
詹金斯的工作建立在不从节点

Started by user admin 
Building remotely on jenkins-slave (slave) in workspace /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq 
Cloning the remote Git repository 
Cloning repository [email protected]:xxxxxxx/wcount.git 
> git init /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq # timeout=10 
Fetching upstream changes from [email protected]:xxxxxxx/wcount.git 
> git --version # timeout=10 
using GIT_SSH to set credentials 71bnh6gke9kmabye9qu2qsazzpofjsa 
> git -c core.askpass=true fetch --tags --progress  [email protected]:xxxxxxx/wcount.git +refs/heads/*:refs/remotes/origin/* 
> git config remote.origin.url [email protected]:xxxxxxx/wcount.git # timeout=10 
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 
> git config remote.origin.url [email protected]:xxxxxxx/wcount.git # timeout=10 
Fetching upstream changes from [email protected]:xxxxxxx/wcount.git 
using GIT_SSH to set credentials 71bnh6gke9kmabye9qu2qsazzpofjsa 
> git -c core.askpass=true fetch --tags --progress  [email protected]:xxxxxxx/wcount.git +refs/heads/*:refs/remotes/origin/* 
> git rev-parse origin/master^{commit} # timeout=10 
Checking out Revision 5730301886fa5c02522705de817c5ddac0f0dbce (origin/master) 
> git config core.sparsecheckout # timeout=10 
> git checkout -f 5730301886fa5c02522705de817c5ddac0f0dbce 
> git rev-list 5730301886fa5c02522705de817c5ddac0f0dbce # timeout=10 
ERROR: Build step failed with exception 
java.lang.IllegalArgumentException: configured dockerFolder  '/home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq' does not exist. 
     at  org.jenkinsci.plugins.dockerbuildstep.cmd.CreateImageCommand.execute(CreateImageCommand.java:93) 
     at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:75) 



主工作空间是/ home/jenkins_home /工作区

从工作区是/ home /詹金斯/工作区

我能找到的/ home /詹金斯/工作区/ 71bnh8co385ctlmoxgbumdnpnet3ywq目录中的从属节点。

我想这建立在主节点,但我看到的任务从队列

回答

1

詹金斯码头工人建造步插件唐不支持任务在从节点上运行,所以你可以改变一些代码来支持它。 添加一个罐子到可以创建图像并推送图像的从机。然后主机在从机上调用该罐子

0

不确定是否是这种情况在这里,但似乎詹金斯设置Dockerfile在Docker build/create任务在Build阶段的路径为$WORKSPACE/docker所以你要么有t o确保你的工作区/ git仓库中有该文件夹(包含Dockerfile和其他需要的文件),或者从上面的路径ENV(这是一个更好的解决方案,imho)中删除docker,Jenkins将从主工作区/ git目录中读取Dockerfile。希望有所帮助。