GitLab基础笔记
【半离线安装】
1、安装ssh
yum install -y curl policycoreutils-pythonopenssh-server
2、将SSH服务设置成开机自启动
systemctl enable sshd
systemctl start sshd
3、安装防火墙
yum install firewalld systemd -y
service firewalld start
systemctl reload firewalld
4、安装Postfix以发送通知邮件
yum install postfix
systemctl enable postfix
systemctl start postfix
5、下载GitLab
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.6.3-ce.0.el7.x86_64.rpm
6、安装gitlab
rpm -i gitlab-ce-11.6.3-ce.0.el7.x86_64.rpm
7、修改gitlab配置
vim /etc/gitlab/gitlab.rb
external_url 'http://localhost:8888' --修改端口
8、启动
gitlab-ctl reconfigure
gitlab-ctl restart
--安装软件
rpm -i gitlab-ce-11.6.3-ce.0.el7.x86_64.rpm
--查看软件
rpm -qa | grep gitlab
--卸载软件
rpm -e gitlab-ce-11.6.3-ce.0.el7.x86_64.rpm
【在线安装】
1、配置yum源
vim /etc/yum.repos.d/gitlab-ce.repo
复制以下内容:
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
2、更新本地yum缓存
yum makecache
3、安装GitLab社区版
yum install gitlab-ce #自动安装最新版
yum install gitlab-ce-x.x.x #安装指定版本
4、修改端口号
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
external_url 'http://192.168.137.12:8888' --修改端口,ip为克隆是显示的ip
gitlab-ctl reconfigure
gitlab-ctl restart
5、GitLab常用命令
gitlab-ctl start # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
gitlab-ctl reconfigure # 启动服务;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
gitlab-ctl tail # 查看日志;
6、安装git
yum install git
7、生成密钥文件
在wayne用户使用的电脑下使用(要克隆代码的)
ssh-keygen -t rsa -C "wayne@imokiu.com"
用户设置->SSH Key->
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCv4E+vd5BP/eHzltMpfZEcFhT6K0DocFyjY+AiPqZ/8hIOHqQf5EjA24dNiCoAqdIj9hOoNTOTL96Y0NuMZ0CsUlYdyz7cDUippm1dJh+d9IfGqnLgormfRmEUNhu8lIpS5e6uhIptSW02bLMDRmbMPhez7NeQe+NGRPgJfjGhnlpP/P8vJG97spuLjsWtuHbSkJRF5jRLbFhXbzpTqovjHmz0VQjEMAk6VM2Ro2A0LwqFgPZ7kqbwOlZPk+7n0HL/vQX438MFOKlaz44Y8TryXv87ps4I1zuFhn2C+WrRmeSYzABs8RpE7q6/u54pT9A1FxeMeSQZyt+VT2bYbjor wayne@imokiu.com
在GitLab的主页中新建一个Project
添加ssh key导入步骤2中生成的密钥文件内容

浙公网安备 33010602011771号