[英]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.