gitlab CI/CD部署

  1. 安装依赖包,运行命令

     sudo apt-get install curl openssh-server ca-certificates postfix
    
  2. 执行完成后,出现邮件配置,选择Internet那一项(不带Smarthost的)

 
gitlab1.png
  1. 利用清华大学的镜像https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/来进行主程序的安装。
    首先信任 GitLab 的 GPG 公钥:
    curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
  2. 利用root用户sudo su ,vim打开文件/etc/apt/sources.list.d/gitlab-ce.list,加入下面一行
    deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main
  3. 安装 gitlab-ce:
    sudo apt-get update
    sudo apt-get install gitlab-ce
  4. 执行命令
    sudo gitlab-ctl reconfigure
  5. 打开 sshd 和 postfix 服务
    service sshd start
    service postfix start
  6. 为了使 GitLab 社区版的 Web 界面可以通过网络进行访问,我们需要允许 80 端口通过防火墙,这个端口是 GitLab 社区版的默认端口。为此需要运行下面的命令
    sudo iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
  7. 检查GitLab是否安装好并且已经正确运行,输入下面的命令
    sudo gitlab-ctl status
  8. 如果得到类似下面的结果,则说明GitLab运行正常
    run: gitlab-workhorse: (pid 1148) 884s; run: log: (pid 1132) 884s
    run: logrotate: (pid 1150) 884s; run: log: (pid 1131) 884s
    run: nginx: (pid 1144) 884s; run: log: (pid 1129) 884s
    run: postgresql: (pid 1147) 884s; run: log: (pid 1130) 884s
    run: redis: (pid 1146) 884s; run: log: (pid 1133) 884s
    run: sidekiq: (pid 1145) 884s; run: log: (pid 1128) 884s
    run: unicorn: (pid 1149) 885s; run: log: (pid 1134) 885s
  9. 在浏览器地址栏中输入:http://127.0.0.1:8080,即可访问GitLab的Web页面




作者链接:https://www.jianshu.com/p/92f97939e33a

猜你喜欢

转载自www.cnblogs.com/bobokekemeile/p/11315574.html