• linux-radhat-gitlab服务搭建


    1.安装gitlab的依赖项

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

    2.设置防火墙

    sudo lokkit -s http -s ssh

    3.启动postfix,并设置为开机启动 

    sudo yum install postfix
    sudo service postfix start
    sudo chkconfig postfix on

    4.添加gitlab库及安装包(gitlab-ce是社区版-免费、gitlab-ee是企业版-收费)

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

    如果网速较慢也可以选择离线安装,下载gitlab的rpm包,地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/

    然后上传至服务器,我的上传到了、opt/software/目录下,然后我在opt目录下执行:

    rpm -i /opt/software/gitlab-ce-10.8.3-ce.0.el6.x86_64.rpm

    5.自动配置gitlab

    gitlab-ctl reconfigure

    这个时间较长,成功以后,访问本机ip(gitlab默认占用80端口)

    6.设置管理员密码

    首次登陆需要修改管理员密码,值得注意的是修改的密码用户名为root而不是administrator

    7.修改配置文件

    vim /etc/gitlab/gitlab.rb

    修改成服务器IP

    更新配置并重启

    gitlab-ctl reconfigure
    gitlab-ctl restart

    7.汉化

    待续...

    8.备份

    81手动备份

    gitlab-rake gitlab:backup:create

    如果 /etc/gitlab/gitlab.rb 配置了参数“backup_path”(例如gitlab_rails['backup_path'] = '/backup'),则备份的目录就是该目录下(/backup/);

    如果没有配置参数“backup_path”,则gitlab把备份文件生成到默认目录/var/opt/gitlab/backups

    8.2自动备份

    //输入命令
    sudo crontab -e
    //输入以下内容(每天凌晨2点备份),然后保存退出
    0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
    //重启crond
    service crond restart

    9.自动清理

    vim /etc/gitlab/gitlab.rb

    将其中backup_keep_time的配置取消注释,根据需要设置自动清理多少天前的备份,我这里是设置备份保留7天(7*3600*24=604800),然后保存。

    gitlab-ctl reconfigure


  • 相关阅读:
    问题python3中的tablib库报错“'Dataset' object has no attribute 'xlsx' tablib”
    下载并运行 Jenkins
    mac上卸载jdk
    Macbook pro 切换显卡
    Mac 安装和使用MongoDB
    PEP8 规范
    完全卸载Xcode
    mysql重置密码
    安装vue mac 不成功
    error:Cannot pull with rebase
  • 原文地址:https://www.cnblogs.com/syuf/p/9156114.html
Copyright © 2020-2023  润新知