在Linux上部署GitLab应用通常涉及以下步骤:
对于基于RPM的Linux发行版(如CentOS),通常需要安装以下依赖:
sudo yum update
sudo yum install -y curl policycoreutils-python openssh-server perl
对于基于Debian的发行版(如Ubuntu),依赖命令如下:
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo yum install gitlab-ce
sudo apt-get install gitlab-ce
/etc/gitlab/gitlab.rb
文件,设置 external_url
为你的服务器IP地址或域名。external_url 'http://your-server-ip'
sudo gitlab-ctl reconfigure
启动GitLab服务:
sudo gitlab-ctl start
在浏览器中输入你的服务器IP或域名,按照提示完成初始设置。
如果你使用的是UFW防火墙,允许HTTP和HTTPS流量:
sudo ufw allow 'Nginx Full'
sudo ufw allow 'OpenSSH'
sudo ufw enable
如果你希望GitLab在系统启动时自动运行,可以使用systemd:
sudo systemctl enable gitlab-ce
sudo systemctl start gitlab-ce
以上步骤是在Linux系统上部署GitLab的基本流程。根据你的具体需求,可能还需要进行更多的配置和优化,例如安装和配置数据库、设置邮件服务、配置CI/CD等。建议参考GitLab的官方文档以获取更详细的指导。