Jenkins配置git插件以及服务器安装git
1、git安装包
2、git安装在和Jenkins同一个服务器上
1、git所需的安装依赖包
#yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils
2、解压git安装包
tar xzf git-1.8.3.1.tar.gz
3、确认所在服务器是否安装了cmake
cmake下载地址:http://www.cmake.org/cmake/resources/software.html
[[email protected] mysql-5.6.4-m7]# yum install ncurses-devel*
[[email protected] mysql-5.6.4-m7]# rm CMakeCache.txt (注意这里是删除CMakeCache.txt ,有一个跟它很相似的文件,别删错了!)
[[email protected] mysql-5.6.4-m7]#make
[[email protected] mysql-5.6.4-m7]#make install
[[email protected] tmp]# cd cmake-2.8.9/
[[email protected] cmake-2.8.9]# ./bootstrap
[[email protected] cmake-2.8.9]#make
[[email protected] cmake-2.8.9]#make install
如果要更新cmake 只需进入相关目录,执行
cmake.
make
make install
4、编译
[[email protected] cmake-2.8.9]#cd git-1.8.3.1# make prefix=/usr/local/opt/git all
[[email protected] cmake-2.8.9]# make prefix=/usr/local/opt/git install
5、添加到执行文件中
[[email protected] cmake-2.8.9]# echo "export PATH=$PATH:/usr/local/opt/git/bin" >>/etc/bashrc# source /etc/bashrc
6、查看版本
[[email protected] cmake-2.8.9]# git --version
7、Jenkins配置git
jenkins-系统管理-全局变量配置
8、Jenkins服务器生成**对(无需设置密码)
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): (直接回车)
Enter passphrase (empty for no passphrase): (不需要输入密码)
Enter same passphrase again:
Your identification has been saved in /home/hadoop/.ssh/id_rsa.
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is: 79:0a:3d:04:3d:83:d5:24:a8:94:62:89:f3:b7:90:f8 [email protected]
9、登录git服务器,点击头像-settings-SSH keys
key内容填写id_rsa.pub公钥的内容
title随便写
10、构建项目配置
a.git参数
b.输入git路径