CentOS配置Jenkins

本文主要记录自己在CentOS安装Jenkins时遇到的问题。希望对大家有所帮助:

安装步骤比较简单,Centos安装tomcat,部署Jenkins的包,然后根据需要安装插件(如git、maven等)即可。这里不再赘述。

然后在Jenkins的“系统管理”->“Global Tool Configuration”中配置JDK、Git、Maven。如下图所示:

1、遇到的第一个问题:Git安装后,配置项目的git路径后,Jenkins马上在工程的git路径下面提示如下错误:

Failed to connect to repository : Command "git config --local credential.helper store --file=/tmp/git2956041026506359040.credentials" returned status code 129:
stdout:
stderr: error: unknown option `local‘
usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    -f, --file <FILE>     use given config file

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 adds a new variable: name value
    --unset               removes a variable: name [value-regex]
    --unset-all           removes all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            opens an editor
    --get-color <slot>    find the color configured: [default]
    --get-colorbool <slot>
                          find the color setting: [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte

原因:git版本过低。原来我是用yum install git安装的git,执行git --version,发现版本是1.7.1。而Jenkins需要1.7.4以上的git版本,才支持--local选项。

解决方法:网上搜了一些文章,可以自行下载git 2.1.2的源码,下载gcc然后自己编译。文章在这里,大家可以参考我转载的这篇文章《Centos 6.5升级git版本的办法》

完成后,不再报此错误。

2、遇到的第二个问题:git提示新的问题:

Failed to connect to repository : Command "/usr/local/git/bin/git -c core.askpass=true ls-remote -h http://www.xxx.com/gitlab/root/test.git HEAD" returned status code 128:
stdout:
stderr: fatal: Unable to find remote helper for ‘http‘

或者

Failed to connect to repository : Command "git ls-remote -h [email protected]:xxx/dev_test.git HEAD" returned status code 128:
stdout:
stderr: Permission denied, please tryagain.
Permission denied, please try again.
Permission denied(publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: The remote end hung up unexpectedly

原因:没有配置git的ssh key。

解决方法:执行下面的命令,生成key

ssh-keygen -t rsa -C "[email protected]"

然后将~/.ssh/目录下的id_rsa.pub中的公钥,放到git的ssh key中。再在Jenkins中创建新的Credentials。类型是SSH Username with private key。Username使用ssh-keygen中用到的邮箱,Private Key中选择“From the Jenkins master ~/.ssh”即可。

修改后,问题解决。

3、安装Maven。

Maven不支持通过Centos的yum进行安装,需要手工安装。大家可以参考我转载的这篇文章:《Centos6.5安装Maven

时间: 2024-08-05 02:43:33

CentOS配置Jenkins的相关文章

CentOS配置Jenkins和Nginx

1.Jenkins 下载地址:https://jenkins.io/zh/download/ 复制下载地址: wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war 第一次启动,需要填入密码,按照提示的地址去查找.然后下载相应的插件即可. 2.Nginx 2.1 下载 下载nginx需要的依赖 yum install -y gcc gcc-c++ yum install -y pcre pcre-devel yum install

Linux Centos安装Jenkins

转载:http://itjh.net/2016/04/26/centos-install-jenkins/ Jenkins 是一个开源项目,提供了一种易于使用的持续集成系统,使开发者从繁杂的集成中解脱出来,专注于更为重要的业务逻辑实现上.同时 Jenkins 能实施监控集成中存在的错误,提供详细的日志文件和提醒功能,还能用图表的形式形象地展示项目构建的趋势和稳定性. Centos 6.7Jenkins 2.0 yum安装Jenkins 创建 jenkins 的 yum 的源文件 $ vim /e

阿里云CentOS配置全过程

阿里云CentOS配置全过程 拿到服务器的ip.初始密码以后.我们先要用远程连接工具putty连接服务器主机. 启动putty.exe程序,进入putty主界面,在Host Name 栏中输入你的服务器ip地址,Saved Sessions 填入你的主机名称(可自定义,用于区别你的服务器).点击Save保存配置.选中你的服务器名点击open开始连接服务器. 第一次连接,会出现对话框,点击是 出现登录界面,输入用户名,默认为超级用户root,接着输入密码,要注意的是密码不会显示在屏幕上.输入密码时

CentOS 配置防火墙操作实例(启、停、开、闭端口)

CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service   iptables status<回车>   停止防火墙: [root@localhost ~]# service   iptables stop <回车>   启动防火墙: [root@localhost ~]# service   iptables start <回车>   重启防火墙: [root@loc

CentOS 配置httpd使局域网可以正常访问

[转载请注明出处: 钱国正的专栏http://blog.csdn.net/qianguozheng/article/details/37611859] 问题: 在CentOS上安装apache,配置好服务器本机可以访问,但是外部局域网IP不能访问 解决方法: 1.修改配置文件/etc/httpd/conf/httpd.conf <Directory "/var/www/cgi-bin"> AllowOverride None Options None Order allow

centos配置不用本地的smtp

当使用mail命令发邮件时,默认的是使用本地的smtp服务,centos5的时候是sendmail,centos6的时候是postfix.但每台机器都维护一个smtp服务,成本开销很大. 通过修改/etc/mail.rc可以指定远程的smtpserver cat >> /etc/mail.rc << EOF # For set smtpserver set smtp=192.168.122.100 #下面三行不一定需要打开,根据实际情况而定 #set smtp-auth=login

CentOS配置网易源

centos配置网易源 参考: http://mirrors.163.com/.help/centos.html 1.下载CentOS6-Base-163.repo:(这里以centos6为例.请换成自己对应版本) http://mirrors.163.com/.help/CentOS6-Base-163.repo 放入:/etc/yum.repos.d/目录: cp CentOS6-Base-163.repo /etc/yum.repos.d/ 2.备份/etc/yum.repos.d/Cen

手把手教你搭建和配置Jenkins环境

搭建Jenkins,首先得安装Jenkins,安装的问题就不说了,一般第一次安装完成后,服务会直接在浏览器中运行,网址:http://localhost:8080.然后新建一个用户,登录 接下来就是如何配置Jenkins,我们现在做的系统是.Net平台的,所以配置的Jenkins适用于.Net,至于说Java的配置,暂时还不涉及,就不在这儿讲了. 配置SVN并新建一个简单的网站 由于是在自己的电脑上做的实验,所以还需要安装SVN的服务端和客户端,在SVN服务器上新建一个Repository--J

centos 配置 samba 与windows共享文件夹

yum install samba/etc/samba/smb.confdirectory mask = 0777 ← 指定新建目录的属性(以下4行) force directory mode = 0777 directory security mask = 0777 force directory security mode = 0777 create mask = 0777 ← 指定新建文件的属性(以下4行) force create mode = 0777 security mask =