美文网首页
手把手教你GitLab的安装及使用

手把手教你GitLab的安装及使用

作者: 织梦少年666 | 来源:发表于2019-08-20 11:08 被阅读0次

本篇文档介绍了在阿里云上如何使用弹性云服务器的Linux实例手工部署GitLab。GitLab 是 Ruby 开发的自托管的 Git 项目仓库,可通过Web界面进行访问公开的或者私人项目。

前提条件

  • 部署GitLab的实例要求至少使用2个vCPU和4GB的内存。
  • 参考添加安全组规则,添加如下表所示的安全组规则。
    image.png
1.安装依赖包

sudo yum install -y curl policycoreutils-python openssh-server

2.设置SSH开机自启动并启动SSH服务。

sudo systemctl enable sshd
sudo systemctl start sshd
如果不支持systemctl命令,可以使用service命令启动

3.安装Postfix来发送通知邮件。

sudo systemctl enable sshd

4.设置Postfix开机自启动。

sudo systemctl enable postfix

5.启动Postfix服务。
image.png
6.添加GitLab软件包仓库。

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

7.sudo EXTERNAL_URL="GitLab服务器的公网IP地址" yum install -y gitlab-ce

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

8.使用浏览器访问GitLab服务器的公网IP地址,显示如下页面,说明环境搭建成功。
image.png
如果无法访问,请先看Linux服务器80端口是否被占用,或者无法访问80 可以在windos telnet 主机ip 80
如果可以访问,但是报502,那就是你的8080端口被占用了,可以停掉8080端口的服务,就可以啦
报502如果不想kill 8080端口,还可以修改/etc/gitlab/gitlab.rb (但是我个人试了 貌似不行 还是kill 8080)
unicorn['port'] = 9090
再gitlab-ctl reconfigure 重启配置,这样GitLab服务器就可以正常运行了。

GitLab使用

1.新建project项目
image.png
2.把本地项目上传到git 进行协同开发
image.png
3.上传文件到gitlab
image.png
image.png

原文参考:https://help.aliyun.com/document_detail/52857.html
说明了 在部署时遇到的坑

相关文章

网友评论

      本文标题:手把手教你GitLab的安装及使用

      本文链接:https://www.haomeiwen.com/subject/qvuusctx.html