在window7上安装JJB(Jenkins Job Builder)

来源:互联网 发布:linux cpu使用率 命令 编辑:程序博客网 时间:2024/06/07 00:50

准备工作

如果你的windows7上已经安装python,setuptools, pip。准备工作可以跳过去

安装Python

从https://www.python.org/downloads/下载python-*.msi(例如python-2.7.6.amd64.1394777203.msi)。 然后直接双击安装.
安装完后, 添加python(例如 C:\Python27;) 到 Windows的环境变量里。
(测试是否安装成功,在cmd里运行python --version)

安装 setuptools

下载https://bootstrap.pypa.io/ez_setup.py ,双击或者运行命令python ez_setup.py都可以安装。
安装完后, 添加python(例如 C:\Python27\Scripts;) 到 Windows的环境变量里。
注意:
如果安装过程遇到以下错误,改一下默认的编码格式就行。

UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal not in range(128)You may need to set the default code to 'UTF-8'.Find the file refer to error stack.

在错误堆栈里找到是哪个文件哪行出错了,在相应位置加上

reload(sys)sys.setdefaultencoding('utf-8')

我的错误堆栈里的消息是

File "C:\Python27\lib\mimetypes.py", line 248, in enum_typesctype = ctype.encode(default_encoding) # omit in 3.x!UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 1: invalid start byte

找到mimetypes.py,在 default_encoding = sys.getdefaultencoding()前面加上那两句就行了。

安装 pip

下载 https://bootstrap.pypa.io/get-pip.py ,双击或者运行命令python get-pip.py都可以安装。

安装 JJB

从https://pypi.python.org/pypi/jenkins-job-builder/下载jenkins_job_builder-1.3.0-py2-none-any.whl
运行命令pip install jenkins_job_builder-1.3.0-py2-none-any.whl安装
测试是否安装成功,运行命令jenkins-jobs --version.

安装完成。
如果要测试一下,需要拿到JJB的源代码:git clone https://git.openstack.org/openstack-infra/jenkins-job-builder
具体信息查看:http://docs.openstack.org/infra/jenkins-job-builder/

0 0
原创粉丝点击