close

前陣子安裝git + gitolite/gitosis + gitweb

花了不少時間找資料,最後gitweb還是抓不到repository.

所幸最近在逛網頁時,才發現原來有更多的人採用了gitlab的整合服務.

當然馬上來試試(CentOS 6),相對來說實在方便太多了(當然就更多東西對我來講是黑盒子

 

安裝

首先切換到root (或用sudo)

yum install curl openssh-server openssh-clients postfix cronie

service postfix start

chkconfig postfix on
lokkit -s http -s ssh
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash
yum install gitlab-ce

 

修改配置 => vi /etc/gitlab/gitlab.rb  (全部其他的配置也都在該檔內

external_url    外部的連結url,若是內部使用可以改為IP

gitlab_rails['backup_path']      執行備份指令時,備份檔存放位置,預設/var/opt/gitlab/backups

gitlab_rails['gitlab_shell_ssh_port']     ssh連結透過的port
nginx['listen_addresses']         綁定nginx ip

註 : gitlab_rails['gitlab_shell_ssh_port'] ,nginx['listen_addresses'] 當你既有環境衝突時調整.

 

gitlab-ctl reconfigure

gitlab-ctl restart

預設帳密

root 

5iveL!fe

 

備份

gitlab-rake gitlab:backup:create

會在備份路徑下,產生一個檔案 TIMESTAMP_gitlab_backup.tar

使用crontab -e (root權限)添加排程

0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create

 

還原

先停止gitlab

停止相關服務

gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq

還原特定備份檔,(檔案要先放到備份路徑下喔)

gitlab-rake gitlab:backup:restore BACKUP=TIMESTAMP

啟動服務

sudo gitlab-ctl start

 

註:備份還原的gitlab版本最好相同

版本查看 http://ip/help

 

參考

https://about.gitlab.com/downloads/#centos6

https://gitlab.com/gitlab-org/omnibus-gitlab/blob/...

http://mycodetub.logdown.com/posts/260395-gitlab-b...

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 abcg5 的頭像
    abcg5

    Aaron Yang

    abcg5 發表在 痞客邦 留言(0) 人氣()