Jenkins配置git插件以及服务器安装git

来源:互联网 发布:快手虚拟定位软件 编辑:程序博客网 时间:2024/05/27 18:17

 

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

[root@localhost mysql-5.6.4-m7]# yum install ncurses-devel*

[root@localhost mysql-5.6.4-m7]# rm CMakeCache.txt (注意这里是删除CMakeCache.txt ,有一个跟它很相似的文件,别删错了!)

[root@localhost mysql-5.6.4-m7]#make

[root@localhost mysql-5.6.4-m7]#make install



[root@localhost tmp]# cd cmake-2.8.9/

[root@localhost cmake-2.8.9]# ./bootstrap

[root@localhost cmake-2.8.9]#make

[root@localhost cmake-2.8.9]#make install


如果要更新cmake 只需进入相关目录,执行

cmake.

make

make install

4、编译

[root@localhost cmake-2.8.9]#cd git-1.8.3.1# make prefix=/usr/local/opt/git all

[root@localhost cmake-2.8.9]# make prefix=/usr/local/opt/git install

 

5、添加到执行文件中

[root@localhost cmake-2.8.9]# echo "export PATH=$PATH:/usr/local/opt/git/bin" >>/etc/bashrc# source /etc/bashrc

 

6、查看版本

[root@localhost cmake-2.8.9]# git --version

 

7、Jenkins配置git

jenkins-系统管理-全局变量配置

 

8、Jenkins服务器生成密钥对(无需设置密码)

命令:ssh-keygen -t rsa
Generating public/private rsa key pair.
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 hadoop@test

 

9、登录git服务器,点击头像-settings-SSH keys

key内容填写id_rsa.pub公钥的内容

title随便写

 

 

10、构建项目配置

a.git参数

b.输入git路径