Jenkins无法清理工作空间,随后无法与Python项目一起运行

时间:2018-06-21 13:23:05

标签: python docker jenkins

我的设置如下:

  • 我有一个Python项目,我在docker容器中运行tox测试。
  • 我让Jenkins构建并执行该docker容器

它可以工作一段时间,但是在某些时候,詹金斯似乎无法从工作空间中删除内容。当我尝试手动清洁它时(通过单击“清洁工作区”按钮,我收到了Jenkins错误。

代码

Makefile

dockertest:
    docker-compose build test
    docker-compose run --rm test
    docker-compose down --rmi local

docker-compose.yml

version: "2"

services:
  test:
    build: .
    volumes:
      - ./tests:/usr/src/app/tests
    command: ["python", "-B", "-m", "tox"]

Jenkins生成错误消息

> git checkout -f abcdef1234567890123456789012345678901234
 > git rev-list 1234567890abcdef1234567890abcdef12345678 # timeout=10
Set build name.
New build name is 'origin/featurebranch: abcdef1'
[jenkinsjobname] $ /bin/sh -xe /tmp/somethinglong.sh
+ make dockertest
docker-compose build test
Building test
Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Makefile:7: recipe for target 'dockertest' failed
make: *** [dockertest] Error 1
Build step 'Execute shell' marked build as failure

詹金斯崩溃:错误消息

A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.

Stack trace
java.io.IOException: remote file operation failed: /.../workspace/jenkinsjobname at hudson.remoting.Channel@4b7d4b7c:build-slave-94d006c6: java.nio.file.AccessDeniedException: /.../workspace/jenkinsjobname/mypythonmodule.egg-info/zip-safe
    at hudson.FilePath.act(FilePath.java:986)
    at hudson.FilePath.act(FilePath.java:968)

这与zip_safe有何关系?这是怎么回事?

0 个答案:

没有答案