码迷,mamicode.com
首页 > 其他好文 > 详细

1)gitlab+jenkins自动化发布;gitlab搭建

时间:2018-07-09 12:28:33      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:node   one   url   src   www   comm   下载   compress   otto   

                             安装gitlab

 

 

 

参考文档:

https://www.yiibai.com/gitlab/gitlab_introduction.html

 

 

1、下载epel

 wget http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm

2wget -O /etc/yum.repos.d/CentOS-Base.repo

3、关闭防火墙和seLinux

4 yum install curl policycoreutils openssh-server openssh-clients postfix -y

5、由于网络问题使用清华大学的镜像源

cat /etc/yum.repos.d/gitlab-ce.repo

[gitlab-ce]

name=gitlab-ce

baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

repo_gpgcheck=0

gpgcheck=0

enabled=1

gpgkey=https://packages.gitlab.com/gpg.ke

 

6yum makecache

yum install -y gitlab-ce

 yum install -y git

7、配置并启动gitlab-ce

gitlab-ctl reconfigure

8、查看状态

 技术分享图片

9、设置密码至少8位那就是12345678;用户root

 技术分享图片


10、创建一个组

技术分享图片 

 

 技术分享图片


 技术分享图片

11、创建一个项目

 技术分享图片

 技术分享图片

 

技术分享图片

这里的路径需要去配置文件中修改:

 技术分享图片

 技术分享图片

之后启动生效。

创建完成之后它提示我们可以创建一个key对它进行管理

我们点击上面的README然后我们随便在里面写点东西 

 技术分享图片

技术分享图片

创建ssh免秘钥登陆 模拟使用gitlab这台服务器当做客户端

ssh-keygen -t rsa -C “你的邮箱”回三次车,密码为空


技术分享图片

然后将密钥传到gitlab上面:

技术分享图片

技术分享图片


添加完之后我们就可以使用用户,就可以拉了 

这里需要做dns我们就在/etc/hosts/中修改

技术分享图片

测试一下:

技术分享图片

我们上传一个代码文件试试,一回发布到tomcat服务器上:这里已经上传了,但是简单说一下就行:这里吧index.html改成了server.xml

创建一个index.html用来模拟开发写代码并提交

[root@node1 test]# pwd

/test/test

[root@node1 test]# cat index.html

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

</head>

<body>

<h1>测试</h1>

</body>

</html>

[root@node1 test]# git add *    ##提交所有更改信息(删除 增加文件)

[root@node1 test]# git config --global user.email "******@163.com"   ##身份验证

[root@node1 test]# git config --global user.name "root"             ##身份验证

[root@node1 test]# git commit -m "add index.html"         ##

[master 1cdcea5] add index.html

 1 file changed, 10 insertions(+)

 create mode 100644 index.html

[root@node1 test]# git push origin master

Counting objects: 4, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (3/3), done.

Writing objects: 100% (3/3), 382 bytes | 0 bytes/s, done.

Total 3 (delta 0), reused 0 (delta 0)

To git@192.168.1.121:root/test.git

   5b44e15..1cdcea5  master -> master

验证查看gitlab上是否有提交的index.html

技术分享图片


1)gitlab+jenkins自动化发布;gitlab搭建

标签:node   one   url   src   www   comm   下载   compress   otto   

原文地址:http://blog.51cto.com/xiaorenwutest/2139031

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!