gitlab社区版安装

gitlab社区版安装,第1张

1、安装依赖

2、安装Postfix以发送通知电子邮件

安装命令:yum install postfix

激活命令systemctl enable postfix

启用命令: systemctl start postfix

3、gitlab社区版地址 https://packages.gitlab.com/gitlab/gitlab-ce

4、初始化配置:gitlab-ctl reconfigure

5、

启动命令:gitlab-ctl start

停止命令:gitlab-ctl stop

重启命令:gitlab-ctl restart

安装后,已弊伍经自动安装成开机启动服务

服务则核启动命令:systemctl start gitlab-runsvdir.service

服务停止命租盯或令:systemctl stop gitlab-runsvdir.service

服务重启命令:systemctl restart gitlab-runsvdir.service

服务开机启动命令:systemctl enable gitlab-runsvdir.service

取消开机启动命令:systemctl disable gitlab-runsvdir.service

服务查看命令:systemctl list-unit-files

1,安装gitlab,参考:[ https://www.jianshu.com/p/d3686bc94ac9]

安装完毕配置external_url时把原来的域名改成自己实际的ip地址加上端口号,端口号默认是80,配置最好大于4G内存。

2,可以修改gitlab配置文件,修改默认数据目录和备份文件目录。

3,安让缓袭装配置gitlab-mirrros,参考:[ https://www.jianshu.com/p/70b138f88514]

安装python setup.py install这一步时如果报如下错误:

“error: Setup script exited with error in urllib3 setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.”

那么就需要更新setuptools的版本,首先yum install python-pip,然后pip install --upgrade setuptools,再执行python setup.py install即可正常安装。

4,添加仓库同步配置,这一步如果报如下错误

“Traceback (most recent call last):

File "lib/manage_gitlab_project.py", line 12, in <module>

raise ImportError("python-gitlab module is not installed. You probably didn't read the install instructions closely enough. See docs/prerequisites.md.")

ImportError: python-gitlab module is not installed. You probably didn't read the install instructions closely enough. See docs/prerequisites.md.

There was an unknown issue with manage_gitlab_project.py

那么则按提示安装模块:sudo yum install python-gitlab,然后在添加仓库同步配置即可。

5,同步和备份

编辑vim /etc/crontab

systemctl restart crond

每天夜晚23:50同步所有项目(gitmirror为执行命令的用户名,即为哪稿gitlab-mirrors项目中config.sh中配置的system_user)

50 23 * * * gitmirror sh /home/gitmirror/坦兄gitlab-mirrors/git-mirrors.sh

每天凌晨4:10备份所有项目

10 4 * * * root /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1

如下是版本建议

GitLab database必须开启 pg_trgm 扩展。使用PostgreSQL super user 开启扩展 。

有些系统,还需要安装额外的包来支持扩展功能 (for example, postgresql-contrib ) 。

支持如下浏览器:

Install self-managed GitLab

官方强烈建议使用 官方Linux包 安装,更快安装、更易升级, 并且它包含了其他安装方式没有的特性来加强可靠尺轮性。强烈 建议最少 4GB 可用内存 运行Gitlab。

基于CentOS7 安装

关闭selinux

关闭firwalld

安装Postfix

这里使用腾讯云CVM+负载均衡CLB+证书。所以不带参数安装,参数手动配置。

可以陵棚信看到安装文件都部署于/opt/gitlab目录下和拿

https://docs.gitlab.com/omnibus/README.html#installation-and-configuration-using-omnibus-package

配置文件 /etc/gitlab/gitlab.rb

执行 gitlab-ctl reconfigure 使配置生效

也可以添加多个 Git data 目录,配置如下:

手动修改克隆地址后,不能再执行 gitlab-ctl reconfigure。gitlab-ctl reconfigure会使用 /etc/gitlab/gitlab.rb覆盖所有配置。

或者执行gitlab-ctl reconfigure后,再手动配置下也行

修改配置文件/opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml:

在使用 gitlab-ctl reconfigure 命令初始化配置的时候,创建了 gitlab-runsvdir.service

可以使用如下命令启动/停止服务

查看服务状态

第一次登陆,会重定向到重设密码页面。输入初始管理员密码,然后会返回到登陆页面。默认账户root。

See our documentation for detailed instructions on installing and configuration .

After completing your installation, consider the recommended practices to secure your GitLab instance .


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12449887.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存