Skip to content

Instantly share code, notes, and snippets.

@Moln
Last active March 5, 2018 09:14
Show Gist options
  • Select an option

  • Save Moln/2a9189578b772db68bf8f359424611d9 to your computer and use it in GitHub Desktop.

Select an option

Save Moln/2a9189578b772db68bf8f359424611d9 to your computer and use it in GitHub Desktop.
Gitlab install

安装

参考地址:https://about.gitlab.com/downloads/

  1. 安装基础依赖服务
sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
  1. yum 安装 gitlab-ce
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

中国地区建议使用中国源(yum 源中加入以下说明的源) https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce

SVN 导入 gitlab

参考资料: https://docs.gitlab.com/ce/workflow/importing/migrating_from_svn.html

遇到的坑

  1. git push 提示 GitLab: The project you were looking for could not be found.
>git push -u origin master
...
remote: GitLab: The project you were looking for could not be found.
To http://192.168.150.162/xiemaomao/test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
...

原因: 原因是我对git-data 目录使用了链接.

解决: 修改 /etc/gitlab/gitlab.rb 配置 git_data_dirs 字段,我的目录路径是使用 ln -s 链接过去的,配置说明说不支持 symlink.官方注释说明说不能使用ln链接

### For setting up different data storing directory
###! Docs: https://docs.gitlab.com/omnibus/settings/configuration.html#storing-git-data-in-an-alternative-directory
###! **If you want to use a single non-default directory to store git data use a
###!   path that doesn't contain symlinks.**
git_data_dirs({"default" => "/data/opt/gitlab/git-data"})

gitlab-ci

安装参考: https://docs.gitlab.com/runner/install/linux-repository.html#install-using-official-gitlab-repositories

其它参考: GitLab CI持续集成配置方案

选用的 Excutor 为 docker, docker 的使用请看以下说明.

docker 安装及容器使用

安装说明

由于中国网络问题连接 ** 官方源 ** 连接过于慢,需要选用中国源

[root@localhost ~]# more /etc/yum.repos.d/docker.repo 
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

Docker镜像容器

Docker默认连接官方镜像源, 中国网络问题需要修改镜像源地址

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment