您可以捐助,支持我们的公益事业。

1元 10元 50元





认证码:  验证码,看不清楚?请点击刷新验证码 必填



  求知 文章 文库 Lib 视频 iPerson 课程 认证 咨询 工具 讲座 Model Center   Code  
会员   
   
 
     
   
 订阅
  捐助
持续集成之Jenkins+Gitlab实现持续集成 [二]
 
来源:csdn 发布于:2017-11-7
   次浏览      
 

本文是第二篇,第一篇持续集成之Jenkins+Gitlab简介 [一]

项目:使用git+jenkins实现持续集成

开始构建

General

源码管理

我们安装的是git插件,还可以安装svn插件

我们将git路径存在这里还需要权限认证,否则会出现error

我们添加一个认证

选择一下认证方式(我们可以在系统管理-->Configure Credentials)里面进行设置

#提示:gitlab有一个key,是我们用来做仓库的key。拥有的权限是read-only

公钥我们需要在服务器上查看。

[root@linux-node1 ~] # ssh-keygen -t rsa
Generating public/ private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
5c:55:51:4e:a0:ad:1f:87: e0:96:9b:24:a3:09:68:62 root@linux-node2
The key's randomart image is:
+--[ RSA 2048]----+
| ..++o|
| . o o |
| . o . .|
| . . . . + . |
| E o . S o * o .|
| . o . o = + o |
| o o . |
| |
| |
+-----------------+


#在192.168.56.11 部署的节点上,生成key

[root@linux-node1 ~] # cat .ssh/id_rsa.pub
ssh-rsa AAAAB3Nza C1yc2EAAAADAQA BAAABAQD WEDIIatng Rx5NaqU6t + f6FvY2RqYp3V3u5CN JS6xAamGokQ 3MnbsTv/V8yKy2TpvNcXsa XmqwQtOVSAO4Bzltid MPxBJUQCqKdMRbPqpzo 7ZqGCuLcCfHC8M6tSbr 1AaHkLbow29Yb CMyzCCkjDfRcOez8yHuLj5BSFp KYCjx2wpJxoZ/ Z6J8Fslsyu7MaRMvUhBMAF 6mqQaC1qZ6K4BMt0Ip AuJvoL 4dNu9P6KcnG3Wy 2zrzoKzkFUi0xpKCmp Yo2bq4zRXgAFAndp4 4j5iMKEavWPeRH0RHTGsfE 5vU5/ 0CI9LCRjtp/ 3vTaYlBryq5vNXb 2abCrJXWws0jwp6L root@linux -node2

我们设置完成后测试git是否可以拉去

[root@linux-node2 ~]# yum install git -y
#如果没有git命令就安装一个git客户端
[root@linux-node1 ~] # git clone git@ www.abcdocker.com: web/web-demo.git
Cloning into 'web-demo'...
The authenticity of host 'www.abcdocker.com (192.168.56.11)' can't be established.
ECDSA key fingerprint is b5:74:8f:f1:03:2d:cb:7d: 01:28:30:12:34:9c:35:8c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'www.abcdocker.com, 192.168.56.11' (ECDSA) to the list of known hosts.
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 10 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (10/10), 70.00 KiB | 0 bytes/s, done.

私钥:

[root@linux-node1 ~]# cat .ssh/
id_rsa id_rsa.pub known_hosts
[root@linux-node1 ~]# cat .ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAoVULn6xsKj + XZMyFOGcFwo0bkrzFRjeZSXby/0BXJJpVaYVj
LEMNOlbD4YHCNTQ4xmyjoeaW468 pciVAooOWCCdc bjDmdmACt9knHjMZ1YRG/xuM
DW/VTLBkP1bOAsa1NR3QE5LR /cwwFeEM/ NcdjzmCVuQeSwL8GeKMKpyKWe6N8mus
QcRLwiDElbQ9e6CqzagKYbIPnuv Cr0XsYjQhGwm0Rhqt2ynr4Ig7FqUhpwmLCQtP
nEq1MbsxDtxugKhiP6kd5zno PdazrKAD9xaRYwSoG /7F4IJMMI5hiKhVya1Bvl5n
M3heJBv61KzW3cvOHuUch6CEt1 ypybkY08R8gw IDAQABAoIBAQCXVnTZ6t9oXlDB
EI1jlFi14LJd2tBfhuY3IOrfgFZ +knvOyX53VcrB0ARdtOAeEoezstNomysuF/EU
D1frWu5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m1ISiuINNbpLY3Gi5 fEvNUSyRx8HzRXP2fydvdgpltDxJUPaUVxvn
X46F8ewsMJ7/FDLSyjdzwvoDRvKCk9 9OBmGmofqh5zW0GrjcQjthmbk=
-----END RSA PRIVATE KEY-----
[root@linux-node1 ~]#

刚刚返回刚刚的区域,继续配置

现在我们复制git的url 就不会出现验证提示

我们选择gitlab,url如下图

查看gitlab版本

[root@linux-node1 ~]# rpm -qa|grep gitlab
gitlab-ce-8.14.5-ce.0.el7.x86_64

我们现在就添加了一个git仓库,现在保存就可以了!

保存完毕后,我们选择立即构建

点击Console Output 可以显示控制台的输出

现在基本就算是构建成功了

 

   
次浏览       
相关文章

为什么要做持续部署?
剖析“持续交付”:五个核心实践
集成与构建指南
持续集成工具的选择-装载
相关文档

持续集成介绍
使用Hudson持续集成
持续集成之-依赖管理
IPD集成产品开发管理
相关课程

配置管理、日构建与持续集成
软件架构设计方法、案例与实践
单元测试、重构及持续集成
基于Android的单元、性能测试