GitLab CE安装nginx
安装比较简单,rpm直接在不一样平台安装git
https://about.gitlab.com/installation/
直接下载源包地址数据库
https://about.gitlab.com/downloads/archives/bash
安装 #yum install curl openssh-server openssh-clients postfix cronie #service postfix start #chkconfig postfix on #lokkit -s http -s ssh #rpm -i gitlab-ce-XXX.rpm
GitLab加载配置与启动ssh
#gitlab-ctl reconfigure #gitlab-ctl start/restart
GitLab日志查看
curl
#gitlab-ctl tail nginx #gitlab-ctl tail unicorn
GitLab CE 备份与恢复socket
备份ide
gitlab-rake gitlab:backup:create 可设置自动备份任务 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:creat
更改默认路径,能够在 /etc/gitlab/gitlab.rb
文件的 gitlab_rails['backup_path']
项中进行设置,默认为 /var/opt/gitlab/backups
。gitlab
恢复post
# 中止须要链接数据库的服务 #gitlab-ctl stop unicorn #gitlab-ctl stop sidekiq # 恢复备份的数据,重写数据库内容 # GitLab 8.15 版本之前所用的时间戳格式为 EPOCH (1393513186) #gitlab-rake gitlab:backup:restore BACKUP=1459620009 # 或# GitLab 8.15 版本之后所用的时间戳格式为 EPOCH_YYYY_MM_DD (1491415349_2017_04_06) # gitlab-rake gitlab:backup:restore BACKUP=1491415349_2017_04_06 # 启动 GitLabsudo gitlab-ctl start # 检查 GitLab 是否正常运行 #gitlab-rake gitlab:check SANITIZE=true
GitLab CE迁移与升级
迁移可参考备份与恢复,须要注意的是:版本号必定要一致
升级
跨版本升级在这里不过多介绍,如大版本9,升级过程下载相关安装包进行安装,自动会完成升级
GitLab CE 使用小节
一、项目地址为localhost
#vi /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: localhost port: 80 https: false
二、merge 、chekout 出现如下错误:
GitLab: The project you were looking for could not be found.
此类错误多出如今git-data挂载软连接致使
如个人挂载 /var/opt/gitlab -> /data/gitlab, 修改参照如下
# /etc/gitlab/gitlab.rb ...... git_data_dirs({ "default" => { "path" => "</data/gitlab/git-data>", 'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket' } }) ......