ubuntu或树莓派搭建gitlab

1. 安装依赖包

  • sudo apt-get install curl openssh-server ca-certificates postfix
  • 当安装postfix依赖包时,用enter键现在确定或者ok。然后在选择Internet site

2. 信任GitLab的GPG 公钥

  • https://packages.gitlab.com/gitlab(具体需要哪一个可以上官网查看,有树莓派版本)
  • curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null(针对ubuntu)
  • curl -s https://packages.gitlab.com/install/repositories/gitlab/raspberry-pi2/script.deb.sh | sudo bash(针对树莓派)

3. 添加镜像源路经

  • sudo vi /etc/apt/sources.list.d/gitlab-ce.list,添加内如如下
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main

4. 下载gitlab

  • sudo apt-get update(一定要执行)
  • sudo apt-get install gitlab-ce
  • 出现如下画面,说明安装成功

Selecting previously unselected package gitlab-ce.
(Reading database ... 100056 files and directories currently installed.)
Preparing to unpack .../gitlab-ce_13.2.5-ce.0_amd64.deb ...
Unpacking gitlab-ce (13.2.5-ce.0) ...
Setting up gitlab-ce (13.2.5-ce.0) ...
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.



     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

5. 配置gitlab的环境

  • sudo gitlab-ctl reconfigure

6. gitlab的启动和关闭以及状态查看

  • sudo gitlab-ctl start
  • sudo gitlab-ctl stop
  • sudo gitlab-ctl status

7. 访问gitlab

http://电脑的IP地址

8. 修改gitlab的端口

  • sudo vim /etc/gitlab/gitlab.rb
将如下数据进行更改
external_url 'http://gitlab.example.com'  
更改为
external_url 'http://ip:端口'  
  • sudo gitlab-ctl reconfigure
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GeekFong

记录不易,坚持更新

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值