簡體   English   中英

jenkins作業構建不在從節點中

[英]jenkins job build not in slave node

通過配置在從機上構建作業(從github構建docker鏡像,從github生成代碼),但未構建成功...如果在主服務器上更改作業,則構建成功


從屬構建消息:

Started by user admin
Building remotely on jenkins-slave (slave) in workspace /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq
Cloning the remote Git repository
Cloning repository git@github.com:xxxxxxx/wcount.git
 > git init /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq # timeout=10
Fetching upstream changes from git@github.com:xxxxxxx/wcount.git
 > git --version # timeout=10
using GIT_SSH to set credentials 71bnh6gke9kmabye9qu2qsazzpofjsa
 > git -c core.askpass=true fetch --tags --progress     git@github.com:xxxxxxx/wcount.git +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url git@github.com:xxxxxxx/wcount.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git@github.com:xxxxxxx/wcount.git # timeout=10
Fetching upstream changes from git@github.com:xxxxxxx/wcount.git
using GIT_SSH to set credentials 71bnh6gke9kmabye9qu2qsazzpofjsa
 > git -c core.askpass=true fetch --tags --progress     git@github.com: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 / workspace

從工作空間是/ home / jenkins / workspace

我可以在從屬節點中找到/ home / jenkins / workspace / 71bnh8co385ctlmoxgbumdnpnet3ywq目錄。

我猜這個建在主節點上,但是我看到了從屬隊列中的任務

jenkins docker-build-step插件不支持在從屬節點上運行任務,因此您可以更改一些代碼以支持它。向slave添加一個jar可以創建映像並推送映像。然后master在slave上調用此jar

不確定是否是這種情況,但似乎Jenkins在Build階段在Docker build/create任務中將Dockerfile的路徑設置為$WORKSPACE/docker docker,因此您必須確保擁有該文件夾(包含Dockerfile和其他所需文件)在工作區/ git倉庫或只是刪除docker從上述路徑ENV(這是一種更好的解決方案,IMHO)和詹金斯將從主工作區/ GIT中目錄讀Dockerfile。 希望能有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM