git clone https://gitlab.com/xhang/gitlab.git
#下载补丁
cat gitlab/VERSION
#查看汉化版本
https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=10.6.4
yum install curl policycoreutils openssh-server openssh-clients && systemctl restart sshd
wget -c https://packages.gitlab.com/gitlab/gitlab-ce/el/7/x86_64/gitlab-ce-9.0.6-ce.0.el7.x86_64.rpm
rpm -ivh gitlab*.rpm
#下载和安装rpm包
vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.example.com'
gitlab-ctl reconfigure
git clone https://github.com/larryli/gitlabhq.git
#下载汉化包
gitlab-ctl stop
#关闭gitlab
head -1 /opt/gitlab/version-manifest.txt
#查看安装的gitlab版本
cd gitlab/
#进入汉化包目录
git diff v10.6.4 v10.6.4-zh >../v10.6.4-zh.diff
cd ..
yum install patch
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < v10.6.4-zh.diff
~~\cp gitlabhq/* /opt/gitlab/embedded/service/gitlab-rails/ ~~
gitlab-ctl start
#启动gitlab
gitlab-ctl status
#查看状态
gitlab-ctl reconfigure
设置管理员密码
管理员账号登录的用户名:root
(虽然登录后管理员的用户名为Administrator,但是实际登录的用户名是root)
cat /etc/gitlab/gitlab.rb
gitlab_rails['ldap_enabled'] = true
###! **remember to close this block with 'EOS' below**
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: ' GitLab LDAP'
host: '10.0.0.200'
port: 389
uid: 'uid'
method: 'plain' # "start_tls" or "simple_tls" or "plain"
bind_dn: 'CN=Manager,DC=huored,DC=com'
password: 'XXX密码'
base: 'DC=huored,DC=com'
EOS
gitlab-ctl restart
#重启服务
/var/opt/gitlab/git-data/repositorie
/opt/github_backup.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #!/bin/bash # 备份docker下github数据 DOCKER_ID=`docker ps |awk '/git/ {print $1}'` sudo docker exec -it $DOCKER_ID /bin/bash -c 'gitlab-rake gitlab:backup:create' # backup : /data/docker/gitlab/data/backups/ #######保留文件数########## ReservedNum=5 #文件所在目录 RootDir=/data/docker/gitlab/data/backups #显示文件数, *.*可以改为指定文件类型 FileNum=`ls -al $RootDir | grep ^- | wc -l` while(( $FileNum > $ReservedNum )) do #取最旧的文件,*.*可以改为指定文件类型 OldFile=$(ls -rt ${RootDir}/*.tar | head -1) echo "Delete File:"${OldFile} rm -f ${OldFile} let "FileNum--" done ls $RootDir |
---|