Linux 安装 GitLab

*********************************************************************************
官网:https://about.gitlab.com/
        Product ——> Install GitLab ——> 选择安装环境CentOS(此出安装命令是收费的ee版本)
            ——> 到底下选择 CE or EE ——> Community Edition ——> CentOS 

一、安装依赖:dnf install -y curl policycoreutils openssh-server openssh-clients
    开机启动:systemctl enable sshd
    启动:systemctl start sshd
    添加http/https服务到firewalld,pemmanent表示永久生效,若不加--permanent系统下次启动后就会失效
        firewall-cmd --permanent --add-service=http
        firewall-cmd --permanent --add-service=https
    重启防火墙:systemctl reload firewalld

    与邮件通知相关的Postfix组件其实可以暂时不用安装和配置,这个可以放到后面再来配置一个外部的SMTP服务器:
    安装: dnf install postfix
    开机启动:systemctl enable postfix
    启动:systemctl start postfix
二、
    添加GitLab包存储库 和安装:
    curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash
    下载并安装:EXTERNAL_URL="https://gitlab.example.com" dnf install -y gitlab-ce  速度很慢,可选择下方方式
  或
    外部下载gitlab可选择版本:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8
    wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-14.6.1-ce.0.el8.x86_64.rpm
    安装:rpm -i gitlab-ce-14.6.1-ce.0.el8.x86_64.rpm
三、
    编辑外部访问地址:修改配置文件:vim /etc/gitlab/gitlab.rb 中 EXTERNAL_URL的值
    # grep -i 'EXTERNAL_URL' /etc/gitlab/gitlab.rb 在文件中找内容 EXTERNAL_URL
        external_url 'https://gitlab.zz.com'   
        git_data_dirs({ "default" => { "path" => "/data/gitlabData" } })  (配置GitLab 数据保存路径)
        
        启动后在路径etc/gitlab下生成密码初始文件initial_root_password
        gitlab默认占用80端口,修改文件 /var/opt/gitlab/nginx/conf/gitlab-http.conf

    刷新配置:gitlab-ctl reconfigure
    停止:gitlab-ctl stop
    重启:gitlab-ctl restart
    
修改本地hosts文件   192.168.58.128   gitlab.zz.com

本地访问:http://gitlab.zz.com/ 账号root 查看密码: cat etc/gitlab/initial_root_password

或通过find / -name initial_root_password 查找文件所在位置
登录后先修改密码:admin123
************************************************************************************************************
添加 SSH Keys
  本地安装Git
  查看公约或生成: Git Bash Here 
    1.输入:cd ~/.ssh
    2.然后输入ls查看秘钥列表:如果没有看到id_ras.pub 文件说明没有配置,这个文件是公共ssh秘钥;
    3.如果没有,输入:cd  ~     然后输入:ssh-keygen.exe 然后按回车,再次按回车,在回车,按三次回车,就可生成密钥id_rsa.pub,使用记事本打开复制内容,添加到远程仓库的ssh密钥中;

创建项目:创建分支:
    变更默认分支:{projectName} ——> Repository ——>branches ——>project settings ——> Default branch
    
    添加User: Menu ——>Admin ——>overview ——>Users
    
    人员授权:Menu ——>Admin ——>overview ——>Projects ——> {projectName}——> Manage access

 

git config --global user.name "myname" 
git config --global user.email "myname@163.cn"

posted @   至丰  阅读(454)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示