gitlab部署

Gitlab部署

部署服务器

172.29.122.35

版本

12.4.0

安装gitlab

[root@cn2031 Downloads]# rpm -i gitlab-ce-12.4.0-ce.0.el7.x86_64.rpm 
warning: gitlab-ce-12.4.0-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
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

修改默认配置

vim /etc/gitlab
### Advanced settings
unicorn['listen'] = '127.0.0.1'
unicorn['port'] = 24000
nginx['listen_addresses']=['*']
nginx['listen_port']=24001

修改nginx代理监控端口

vim /opt/gitlab/embedded/conf/nginx.conf
将listen 由80改为24001

使gitlab配置生效

gitlab-ctl reconfigure

查看gitlab运行状态

gitlab-ctl status
如果全部为run,说明正常启动

卸载gitlab

  • 停止gitlab
    gitlab-ctl stop
  • 卸载gitlab
    rpm -e gitlab-ce
  • 查看gitlab进程
    ps aux | grep gitlab
  • 杀掉第一个进程
    kill -9 18777 #(18777 是第一个进程的pid号,根据显示情况输入)
    ps -ef | grep gitlab | xargs kill -s 9
  • 删除所有包含gitlab文件
    find / -name gitlab | xargs rm -rf

修改gitlab用户密码

[root@cn2031 ~]# gitlab-rails console production
Loading production environment (Rails 4.2.8)
irb(main):002:0> user=User.where(name: "Administrator").first
=> #<User id:1 @root>
irb(main):003:0> user.password='xxxx1234'
=> "xxxx1234"
irb(main):004:0> user.password_confirmation = 'cmcc1234'
=> "cmcc1234"
irb(main):005:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: c19bbd7e-b68e-4989-a8e9-618bd26f240c) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
irb(main):006:0> quit

发布项目配置

  • 填入gitlab所在服务器的私钥
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值