如何使用 python 3.4 和 jenkins 自动化构建过程?

How to automate build process using python 3.4 and jenkins?

我在 git 存储库上有 python (v3.4) 项目,并使用 Jenkins 服务器自动构建过程。 我在 Jenkins 中创建了一个作业,作业从 git 中提取新版本的项目,然后执行两个 shell 命令:

python setup.py build
python setup.py install

在控制台日志中我得到这个错误: ....

nobounce.io 0.0.1 is already the active version in easy-install.pth
Installing sample script to /usr/local/bin
error: [Errno 13] Permission denied: '/usr/local/bin/sample'
Build step 'Execute shell' marked build as failure
Finished: FAILURE

我做错了什么?

您正试图在不允许的服务器上安装软件。一方面,您没有必要的权限。而且您可能无论如何都不应该这样做:假设您有两个工作来创建包(上一个版本的开发和错误修复)。您会在 /usr/local/bin/ 中找到哪一个?这将是非常随机的。

相反,您应该构建一个其他人可以安装的 egg,并告诉 Jenkins 将其存档为构建结果。

如果你有依赖关系,你应该查看 virtualenv: