简体   繁体   English

jenkins作业构建不在从节点中

[英]jenkins job build not in slave node

build job( build docker image ,code from github) in slave machine by configuration,but it do not build success...if change job in master ,it build success 通过配置在从机上构建作业(从github构建docker镜像,从github生成代码),但未构建成功...如果在主服务器上更改作业,则构建成功


slave build message : 从属构建消息:

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)



master workspace is /home/jenkins_home/workspace 主工作区是/ home / jenkins_home / workspace

slave workspace is /home/jenkins/workspace 从工作空间是/ home / jenkins / workspace

i can find /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq directory in slave node。 我可以在从属节点中找到/ home / jenkins / workspace / 71bnh8co385ctlmoxgbumdnpnet3ywq目录。

i guess this build in master node,but i see the task in slave queue 我猜这个建在主节点上,但是我看到了从属队列中的任务

jenkins docker-build-step插件不支持在从属节点上运行任务,因此您可以更改一些代码以支持它。向slave添加一个jar可以创建映像并推送映像。然后master在slave上调用此jar

Not sure if that's the case here, but it seems that Jenkins sets a path to Dockerfile in Docker build/create task at Build stage as $WORKSPACE/docker so you either have to ensure you have that folder (containing Dockerfile and other needed files) in your workspace/git repo or just remove docker from path ENV above (which is a better solution, imho) and Jenkins will read Dockerfile from main workspace/git directory. 不确定是否是这种情况,但似乎Jenkins在Build阶段在Docker build/create任务中将Dockerfile的路径设置为$WORKSPACE/docker docker,因此您必须确保拥有该文件夹(包含Dockerfile和其他所需文件)在工作区/ git仓库或只是删除docker从上述路径ENV(这是一种更好的解决方案,IMHO)和詹金斯将从主工作区/ GIT中目录读Dockerfile。 Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM