部署gitlab
https://about.gitlab.com/install/?version=ce#centos-7
sudo yum install -y curl policycoreutils-python openssh-server openssh-clients perl# Enable OpenSSH server daemon if not enabled: sudo systemctl status sshdsudo systemctl enable sshdsudo systemctl start sshd# Check if opening the firewall is needed with: sudo systemctl status firewalldsudo firewall-cmd --permanent --add-service=httpsudo firewall-cmd --permanent --add-service=httpssudo systemctl reload firewalld
sudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfix
添加gitlab源
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
安装最新版本
yum install -y gitlab-ce
指定安装版本
yum install -y gitlab-ce-13.10.0
修改配置文件
[root@ur-test-docker ~]# grep "^[a-Z]" /etc/gitlab/gitlab.rbexternal_url 'http://192.168.13.74'[root@ur-test-docker ~]#
初始化配置文件
gitlab-ctl reconfigure
离线包下载
https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.10.0-ce.0.el7.x86_64.rpm
升级版本
gitlab升级需要逐步升级,才能保证数据库可用性
https://docs.gitlab.com/ee/update/package/
通过在/etc/gitlab/skip-auto-backup以下位置创建一个空文件来跳过此自动数据库备份
sudo touch /etc/gitlab/skip-auto-backup
gitlab备份
https://docs.gitlab.com/ee/raketasks/backup_restore.html
[root@ur-test-docker ~]# gitlab-rake gitlab:backup:create2021-11-08 14:51:55 +0800 -- Dumping database ...Dumping PostgreSQL database gitlabhq_production ... [DONE]2021-11-08 14:51:59 +0800 -- done2021-11-08 14:51:59 +0800 -- Dumping repositories ...* gitlab-instance-fac58778/Monitoring (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b) ...* gitlab-instance-fac58778/Monitoring (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b) ... [SKIPPED]* gitlab-instance-fac58778/Monitoring.wiki (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.wiki) ...* gitlab-instance-fac58778/Monitoring.wiki (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.wiki) ... [SKIPPED]* gitlab-instance-fac58778/Monitoring.design (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.design) ...* gitlab-instance-fac58778/Monitoring.design (@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.design) ... [SKIPPED]* root/ur (@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35) ...* root/ur (@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35) ... [SKIPPED]* root/ur.wiki (@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.wiki) ...* root/ur.wiki (@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.wiki) ... [SKIPPED]* root/ur.design (@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.design) ...* root/ur.design (@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.design) ... [SKIPPED]2021-11-08 14:51:59 +0800 -- done2021-11-08 14:51:59 +0800 -- Dumping uploads ...2021-11-08 14:52:00 +0800 -- done2021-11-08 14:52:00 +0800 -- Dumping builds ...2021-11-08 14:52:00 +0800 -- done2021-11-08 14:52:00 +0800 -- Dumping artifacts ...2021-11-08 14:52:00 +0800 -- done2021-11-08 14:52:00 +0800 -- Dumping pages ...2021-11-08 14:52:00 +0800 -- done2021-11-08 14:52:00 +0800 -- Dumping lfs objects ...2021-11-08 14:52:00 +0800 -- done2021-11-08 14:52:00 +0800 -- Dumping container registry images ...2021-11-08 14:52:00 +0800 -- [DISABLED]Creating backup archive: 1636354320_2021_11_08_13.10.0_gitlab_backup.tar ... doneUploading backup archive to remote storage ... skippedDeleting tmp directories ... donedonedonedonedonedonedonedoneDeleting old backups ... skippingWarning: Your gitlab.rb and gitlab-secrets.json files contain sensitive dataand are not included in this backup. You will need these files to restore a backup.Please back them up manually.Backup task is done.[root@ur-test-docker ~]#
定时备份
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create
升级最新版本
yum install gitlab-ce -y
查看状态
sudo gitlab-ctl statussudo gitlab-rake gitlab:check SANITIZE=true
