部署 GitLab 服務器

部署 GitLab 服務器

下載地址
官方教程

# 安裝依賴包
[root@root ~]# sudo yum install -y curl policycoreutils-python openssh-server
# 設置SSH開機自啓動
[root@root ~]# sudo systemctl enable sshd
# 啓動SSH服務
[root@root ~]# sudo systemctl start sshd
# 安裝Postfix來發送通知郵件
[root@root ~]# sudo yum install postfix
# 設置Postfix開機自啓動
[root@root ~]# sudo systemctl enable postfix
# 修改 Postfix 配置文件
[root@root ~]# vim /etc/postfix/main.cf
# 啓動Postfix服務
[root@root ~]# sudo systemctl start postfix
inet_interfaces = localhost 改成 inet_interfaces = all
# 添加GitLab軟件包倉庫
[root@root ~]# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
# 安裝GitLab
[root@root ~]# sudo EXTERNAL_URL="GitLab服務器的公網IP地址" yum install -y gitlab-ce

阿里雲添加安全組規則

漢化GitLab

下載地址(選擇對應版本)

# 查看gitlab版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

# 下載漢化包
wget方式(指定版本)
wget https://gitlab.com/xhang/gitlab/-/archive/11-9-stable/gitlab-11-9-stable.tar.gz

# 解壓
tar -axvf gitlab-11-9-stable.tar.gz 
解壓後可以直接刪除下載的壓縮文件了

# 查看版本號   gitlab-11-9-stable  是我的解壓文件,你自己要看下你的是什麼
cat gitlab-11-9-stable/VERSION
或者
cat gitlab/VERSION

# 備份gitlab
cd /opt/gitlab/embedded/service
mv gitlab-rails  pre  // 將原配置文件更名爲 pre
mv /home/vagrant/gitlab-11-9-stable/   gitlab-rails   // 將下載的漢化包,移動過來,並更名

# 重啓配置及重啓gitlab
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章