关闭防火墙
sudo ufw disable
查看防火墙状态
sudo ufw status
1 bitnami-gitlab安装
1.1 准备ssh
1.1.1 安装ssh server
sudo apt-getinstall openssh-server
sudo apt-getinstall openssh-client
1.1.2 查看ssh状态
ps -e|grep ssh
1.2 安装bitnami-gitlab
sudo su
cd /home/david/桌面/ #bitnami-gitlab下载放在Ubuntu桌面
chmod +x ./bitnami-gitlab-8.14.3-0-linux-x64-installer.run
sudo./bitnami-gitlab-8.14.3-0-linux-x64-installer.run
1.3 运行bitnami-gitlab
sudo su
cd'/opt/gitlab-8.14.3-0'
./manager-linux-x64.run或者./ctlscript.shstart
1.4 卸载bitnami-gitlab
cd/opt/gitlab-8.14.3-0
sudo chmod +xuninstall
sudo sh -c
'./uninstall' (如果是root用户则直接./uninstall)
2 备份bitnami-gitlab
cd/opt/gitlab-8.14.3-0/
./use_gitlab
cd/opt/gitlab-8.14.3-0/apps/gitlab/htdocs
bundle execbin/rake gitlab:backup:create RAILS_ENV=production
3 bitnami-gitlab还原
cd/opt/gitlab-8.14.3-0/
./use_gitlab
cd/opt/gitlab-8.14.3-0/apps/gitlab/htdocs
bundle execbin/rake gitlab:backup:restore RAILS_ENV=production BACKUP=1481178730 #这里的数字是备份之后备份文件的前缀
chown git:git-R/opt/gitlab-8.14.3-0/apps/gitlab/repositories
PS:
4 使用docker安装gitlab-ce汉化版
4.1 安装docker
sudo apt-getinstall docker.io
4.2 安装gitlab
4.2.1 创建命名卷
gitlab-config存储GitLab配置信息;gitlab-data存储数据库;gitlab-logs存储日志。
docker volumecreate --name gitlab-config
docker volumecreate --name gitlab-data
docker volumecreate --name gitlab-logs
4.2.2 创建自定义网络,从而让容器运行于独立的网络中,区别于默认网桥
docker networkcreate gitlab-net
4.2.3 运行Gitlab容器
docker run -d \
--hostname 192.168.127.129\ #自己安装gitlab的服务机的IP地址
-p 80:80 \
-p 443:443 \
-p 22:22 \
--name gitlab \
--restart unless-stopped \
-v gitlab-config:/etc/gitlab \
-v gitlab-logs:/var/log/gitlab \
-v gitlab-data:/var/opt/gitlab \
--network gitlab-net \
twang2218/gitlab-ce-zh:8.14.0
(如果本地没有,会先下载docker image,然后安装)
4.3 开启gitlab
docker startgitlab
4.4 关闭gitlab
docker stopgitlab
4.5 卸载gitlab
docker stopgitlab
docker rm gitlab
docker networkrm gitlab-net
docker volume rmgitlab-config gitlab-datagitlab-logs
(都是亲测安装成功的,有问题大家交流)