步骤1:更新系统并安装依赖项
apt-get update
sudo apt upgrade -y
apt-get install -y curl openssh-server ca-certificates
步骤2:邮件配置
选择Internet那一项,不带Smarthost的
apt-get install -y postfix
步骤3:添加GitLab CE存储库
免费版
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash
企业版
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | bash
步骤4:安装GitLab CE
sudo apt-get update
sudo apt-get install gitlab-ce 或者 sudo apt-get install gitlab-ee
---------或
sudo apt update
sudo EXTERNAL_URL="http://xx.xxx.com" apt -y install gitlab-ce
步骤5:更新配置
在执行命令之前,将xx.xxx.com替换为你的实际域名。完成后,通过运行以下命令启动GitLab实例:
sudo gitlab-ctl reconfigure
步骤6:重新启动
sudo gitlab-ctl restart
步骤7:打开 sshd 和 postfix 服务
service sshd start
service postfix start
步骤8:查看gitlab服务器状态
sudo gitlab-ctl status
附:GitLab Administrations
每当你编辑GitLab配置文件 - /etc/gitlab/gitlab.rb时,通过运行以下命令重新配置GitLab服务:
sudo gitlab-ctl reconfigure
sudo gitlab-rake gitlab:check
要检查所有GitLab服务的状态,请使用:
sudo gitlab-ctl status
要停止所有GitLab服务,请使用:
sudo gitlab-ctl stop
要重新启动所有GitLab服务,请使用:
sudo gitlab-ctl restart
你可以通过在最后证明服务名称来重新启动特定服务:
$ sudo gitlab-ctl restart logrotate
ok: run: logrotate: (pid 22824) 0s
Linux 卸载gitlab
- 执行gitlab-ctl stop 停止服务;
- 执行rpm -e gitlab-ce 卸载gitlab;
- 执行ps aux | grep gitlab 查看当前进程中是否还有gitlab进程;如果有执行 kill -9 ****.
- 执行find / -name gitlab | xargs rm -rf 删除所有相关文件;