2016-10-24 66 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。希望有所幫助。