gitLab 配置及使用

    说句题外话今天很失落,一年的PHP同事突然离职,交接半天.

    gitLab 的配置及简单使用:    

    1. 首次访问时,您应该会看到一个初始提示,用于为管理帐户设置密码:

gitlab_initial_password.png

2. 在初始密码提示中,提供并确认管理帐户的安全密码。当您完成单击更改密码按钮。 您将被重定向到传统的GitLab登录页面:

gitlab_first_signin.png


在这里,您可以使用刚刚设置的密码登录。凭证是:

用户名: 根

密码:[您设置的密码]

这些值输入到现有用户的字段, 在点击登录按钮。您将登录到应用程序并转到着陆页,提示您开始添加项目:

废话就不多说了,这边我创建一个我最棒分组,管理冠辉项目

image.png

我其实目前还是用的Root账号,回头我会注册一个账号管理项目.其他的gitlab的如何使用网上也有很多例子参照 关于git使用我老早之前有些过一些基本使用  链接 .我主要讲一下注意点

 

    1. gitlab 项目创建地址改为 实际的IP地址

编辑以下文件:

vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: localhost         >> 这里改为主机的IP即可
    port: 80
    https: false
    # Uncommment this line below if your ssh host is different from HTTP/HTTPS one
    # (you'd obviously need to replace ssh.host_example.com with your own host).
    # Otherwise, ssh host will be set to the `host:` value above

你输入IP访问项目应该就是项目实际IP路径

    2. 汉化Gitlab项目

    注意点在汉化的版本与你实际版本是否一致上:

            1. 如何查看gitLab版本: 

        cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

            2. 克隆GitLab源码仓库

        # 克隆 GitLab.com 仓库
git clone https://gitlab.com/larryli/gitlab.git
#或 Gitcafe.com 镜像,速度更快
git clone https://gitcafe.com/larryli/gitlab.git

        3. 运行汉化补丁

        # 8.5 版本的汉化补丁(8-5-stable是英文稳定版,8-5-zh是中文版,两个 diff 结果便是汉化补丁)
sudo git diff origin/8-5-stable..8-5-zh > /tmp/8.5.diff
# 停止 gitlab
sudo gitlab-ctl stop
# 应用汉化补丁
cd /opt/gitlab/embedded/service/gitlab-rails
git apply /tmp/8.5.diff  
# 启动gitlab
sudo gitlab-ctl start

        4. 打开ip端口号应该就是汉化后的gitlab.

    3. 安装wget包

apt-get update  
apt-get install wget  
wget --version

注意点:

    1. 汉化版本与实际版本一致性.

    2. 备份 /opt/gitlab/embedded/service/gitlab-rails 这个文件夹(重中之重)因为我第一次汉化因为版本不一致导致 temp和log目录不一致,重启gitlab服务失败.有了备份只需要执行 gitlab-ctl restart 和 sudo gitlab-ctl reconfigure就可以找回原来的配置.

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.5.2 Zero

WX:xcs345525801 QQ:345525801 Tel:19521445850 Email:xcssh868@163.com

Copyright © 2020 许承胜个人博客 版权所有 备案号:皖ICP备18014705号-1