ubuntu之在ubuntu16.04中搭建gitlab服务器

1、安装依赖包
 

sudo apt-get update

sudo apt-get install curl openssh-server ca-certificates postfix

注:执行完成后,出现邮件配置,选择Internet那一项(不带Smarthost的)

2、添加gitlab 包服务并安装包

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

3、安装 gitlab-ce

sudo apt-get update

sudo apt-get install gitlab-ce

出现下图即为成功

4、修改服务器地址

sudo gedit /etc/gitlab/gitlab.rb

external_url 'http://192.168.0.88:8888'  # 可以用ifconfig查看电脑的ip,可以添加端口号


5、启动各项服务

sudo gitlab-ctl reconfigure

6、检查GitLab是否安装好并且已经正确运行

sudo gitlab-ctl status

#如果得到类似下面的结果,则说明GitLab运行正常

7、访问及使用

http://192.168.0.88:8888

8、常用命令

sudo gitlab-ctl tail // 查看日志

sudo gitlab-ctl check-config 	//检查在gitlab中是否有任何配置。在指定版本中删除的rb

sudo gitlab-ctl deploy-page 	//安装部署页面

sudo gitlab-ctl diff-config 	//将用户配置与包可用配置进行比较

sudo gitlab-ctl remove-accounts 	//删除所有用户和组

sudo gitlab-ctl upgrade 	//升级

sudo gitlab-ctl service-list 	//查看所有服务

sudo gitlab-ctl once 	//如果GitLab服务停止了就启动服务,如果已启动就不做任何操作

sudo gitlab-ctl restart 	//重启GitLab服务

sudo gitlab-ctl start 	//如果GitLab服务停止了就启动服务,如果已启动就重启服务

sudo gitlab-ctl stop 	//停止GitLab服务

sudo gitlab-ctl status 	//查看GitLab服务状态

sudo gitlab-ctl reconfigure 	//reconfigure重新配置GitLab并启动(修改配置后,必须执行)

9、卸载

sudo gitlab-ctl uninstall

sudo dpkg -r gitlab-ce

sudo rpm -e gitlab-ce

reboot //(重启)

10、查看 GitLab 版本号

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值