Gitlab CE 版本安装
原创
©著作权归作者所有:来自51CTO博客作者X糊涂仙儿的原创作品,请联系作者获取转载授权,否则将追究法律责任
一、安装
1、镜像源 软件
# 163 repo
下载repo文件
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
备份并替换系统的repo文件
cp CentOS7-Base-163.repo /etc/yum.repos.d/
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
mv CentOS7-Base-163.repo CentOS-Base.repo
执行yum源更新命令
yum clean all
yum makecache
yum update
#gitlab-ce 13.3.9 下载,我司用的12.x版
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.3.9-ce.0.el7.x86_64.rpm
2、安装、配置、启动
yum -y install policycoreutils openssh-server openssh-clients postfix
# postfix 安装
systemctl enable postfix
systemctl start postfix
#rpm 安装
yum localinstall gitlab-ce-13.3.9-ce.0.el7.x86_64.rpm -y

[root@gitlab-vm ~]# cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.rb_back
[root@gitlab-vm ~]# vim /etc/gitlab/gitlab.rb
注意端口使用自司规划端口,此处默认80

#初始化,时长因vm配置而异多则5分钟
[root@gitlab-vm ~]# gitlab-ctl reconfigure


二、Project 创建
1、创建项目
New Project - CICD(PRIVATE)

2、push 文件
[root@gitlab-vm .ssh]# git clone git@192.168.1.11:root/cicd.git
Cloning into 'cicd'...
warning: You appear to have cloned an empty repository.
#设置email、devops
[root@gitlab-vm cicd]# git config --global user.email "cicd@example.com"
[root@gitlab-vm cicd]# git config --global user.name "devops"
[root@gitlab-vm cicd]# git commit -m "add readme.md"
[master (root-commit) 473c72e] add readme.md
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 Readme.md
#push 到 master
[root@gitlab-vm cicd]# git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 206 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@192.168.1.11:root/cicd.git
* [new branch] master -> master

四、创建Group
New-group


五、git runner 注册
Git runner register