Fork me on GitHub
Suzf  Blog

How-to quick install GitLab via omnibus

License: Attribution-NonCommercial-ShareAlike 4.0 International

本文出自 Suzf Blog。 如未注明,均为 SUZF.NET 原创。


由于 The Geate Wall 过于强大,有些时候不得不科学上网。 通过 rubygems & 官方 omnibus 也会出现种种问题。 踩坑无数,喜出望外的是发现了 清华大学 TUNA 镜像源 [] # cat /etc/issue Ubuntu 16.04.1 LTS 这里以 Ubuntu 16.04.1 LTS 为例 其他版本可自行到 tsinghua tuna mirror 查看 首先信任 GitLab 的 GPG 公钥:

curl 2> /dev/null | sudo apt-key add - &>/dev/null

然后添加  tsinghua tuna mirrors

sudo echo "deb xenial main" > /etc/apt/sources.list.d/gitlab-ce.list

安装 gitlab-ce

# sudo apt-get update
# sudo apt-get install gitlab-ce
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 302 MB of archives.
After this operation, 812 MB of additional disk space will be used.
Get:1 xenial/main amd64 gitlab-ce amd64 8.12.0-ce.0 [302 MB]
Fetched 302 MB in 56s (5,348 kB/s)                                                                                                                         
Selecting previously unselected package gitlab-ce.
(Reading database ... 58856 files and directories currently installed.)
Preparing to unpack .../gitlab-ce_8.12.0-ce.0_amd64.deb ...
Unpacking gitlab-ce (8.12.0-ce.0) ...
Setting up gitlab-ce (8.12.0-ce.0) ...

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /

gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:

sudo gitlab-ctl reconfigure

gitlab: GitLab should be reachable at
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
It looks like GitLab has not been configured yet; skipping the upgrade script.

# dpkg -l| grep gitlab
ii  gitlab-ce                          8.12.0-ce.0                       amd64        GitLab Community Edition and GitLab CI (including NGINX, Postgres, Redis)

默认配置文件 /etc/gitlab/gitlab.rb 默认目录结构 Omnibus-gitlab uses four different directories. /opt/gitlab holds application code for GitLab and its dependencies. /var/opt/gitlab holds application data and configuration files that gitlab-ctl reconfigure writes to. /etc/gitlab holds configuration files for omnibus-gitlab. These are the only files that you should ever have to edit manually. /var/log/gitlab contains all log data generated by components of omnibus-gitlab. 初始化 GitLab sudo gitlab-ctl reconfigure 启用防火墙的80端口

sudo firewall-cmd --zone=public --permanent --add-rich-rule="rule family="ipv4" source address="" port protocol="tcp" port="80" accept"

sudo firewall-cmd --reload

浏览器使用 gitlab 服务器的IP 访问测试,是否能打开gitlab 主页 默认管理账户为 root, 初次登陆会要求更改密码。






「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」

Suzf Blog

(๑>ڡ<)☆ 谢谢 ~