GitLab 是一個用於倉庫管理系統的開源項目。 使用Git作爲代碼管理工具,並在此基礎上搭建起來的web服務。
我們強烈建議使用 Omnibus 包安裝 GitLab ,因爲它安裝起來更快、更容易升級版本,而且包含了其他安裝方式所沒有的可靠×××。同時我們強烈推薦承載 GitLab 運行的服務器 至少分配4GB的內存 給 GitLab 。
https://www.gitlab.com.cn/installation/
1.安裝並配置必要的依賴關係
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
2.添加GitLab軟件包庫並安裝軟件包
添加GitLab軟件包庫
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
接下來,安裝GitLab軟件包。將`http:// gitlab.fangkuan.com`更改爲您要訪問您的GitLab實例的URL。安裝將自動配置並啓動該URL的GitLab。HTTPS 安裝後需要額外的配置
sudo EXTERNAL_URL="http://gitlab.fangkuan.com" yum install -y gitlab-ee
gitlab通過rpm包安裝後,默認存儲位置在/var/opt/gitlab/git-data/repositories
配置郵件通知
修改配置文件vim /etc/gitlab/gitlab.rb,添加如下配置;
找到【GitLab email server settings】,在其中添加下如配置:
# 以下爲阿里雲企業郵箱的配置
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "***@emjwash.com"
gitlab_rails['smtp_password'] = "******"
gitlab_rails['smtp_domain'] = "emjwash.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['gitlab_email_from'] = '***@emjwash.com'
sudo gitlab-ctl reconfigure # 啓動服務(重新加載配置);
3.瀏覽到主機名並登錄
在第一次訪問時,您將被重定向到密碼重置屏幕。提供初始管理員帳戶的密碼,您將被重定向回登錄屏幕。使用默認帳戶的用戶名root登錄
GitLab常用命令
查看gitlab版本的命令:
gitlab-rake gitlab:env:info
gitlab-ctl start # 啓動所有 gitlab 組件;
gitlab-ctl stop # 停止所有 gitlab 組件;
gitlab-ctl restart # 重啓所有 gitlab 組件;
gitlab-ctl status # 查看服務狀態;
vim /etc/gitlab/gitlab.rb # 修改默認的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 檢查gitlab;
gitlab-ctl tail # 查看日誌;
安裝Git工具linux:
yum -y install git
手動下載並安裝GitLab軟件包
https://docs.gitlab.com/omnibus/manual_install.html
https://packages.gitlab.com/gitlab/gitlab-ce
sudo EXTERNAL_URL="http://gitlab.example.com" rpm -i gitlab-ee-9.5.2-ee.0.el7.x86_64.rpm
更改http://gitlab.example.com爲您要訪問GitLab實例的URL。安裝將自動配置並啓動該URL的GitLab。
gitlab數據遷移:http://blog.csdn.net/hj7jay/article/details/54311010
漢化版:https://gitlab.com/xhang/gitlab
https://blog.51cto.com/bigboss/2129284
git clone https://gitlab.com/xhang/gitlab.git
查看當前gitlab版本並獲取對應版本的中文補丁
[root@localhost ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 8.10.7
cd gitlab
gitlab備份和恢復:https://www.cnblogs.com/kevingrace/p/7821529.html