GitLab 私有 Git
1 GitLab 简介
GitLab 是 整个 DevOps 生命周期 的第一个单一应用程序。只有 GitLab 才能启用Concurrent DevOps,从组件链的约束中解锁组织。GitLab 提供无与伦比的可见性,更高的效率和全面的治理。这使得软件生命周期加快了 200%,从根本上提高了业务速度。
2 GitLab 安装
2.1 CentOS 7 安装
安装步骤:
- 安装并配置必要的依赖项- 在 CentOS 7(和 RedHat / Oracle / Scientific Linux 7)上,以下命令还将在系统防火墙中打开 HTTP 和 SSH 访问。 - sudo yum install -y curl policycoreutils-python openssh-server sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld
- 安装 Postfix 以发送通知电子邮件【可选】 - sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix
- 添加 GitLab 软件包存储库并安装软件包- curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash- 接下来,安装 GitLab 包。将 - http:// gitlab.example.com更改为您要访问 GitLab 实例的 URL。安装将自动配置并启动该 URL 的 GitLab。HTTPS 在安装后需要 其他配置- sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce 
- 初始化配置 - 时间比较久……,需要耐心等待….., 不要做任何操作 - gitlab-ctl reconfigure- 其他命令: - # gitlab 服务操作 服务操作 # 初始化配置 gitlab gitlab-ctl reconfigure # 启动 gitlab 服务 gitlab-ctl start # 停止 gitlab 服务 gitlab-ctl stop
- 浏览到服务器 IP 并登录- 首次访问时,您将被重定向到密码重置屏幕。提供初始管理员帐户的密码,您将被重定向回登录屏幕。使用默认帐户的用户名 - root登录。 - == 需要设置新的密码 == 
2.2 Docker 安装
- 拉取 gitlab、redis、postgresql,gitlab 依赖 redis 和 postgresql。 - docker pull sameersbn/redis docker pull sameersbn/postgresql docker pull gitlab/gitlab-ce:latest
- 创建 postgresql、redis 容器 - docker run --name postgresql -d ‐‐privileged=true -e 'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e 'DB_PASS=password' -e 'DB_EXTENSION=pg_trgm' -v /home/root/opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql- docker run --name redis -d --privileged=true -v /home/root/opt/redis/data:/var/lib/redis sameersbn/redis- 3. 创建 gitlab 容器 - docker run --name gitlab -d --link postgresql:postgresql --link redis:redisio --hostname 192.168.101.64 -p 10022:22 -p 80:80 -e 'GITLAB_PORT=8899' -e 'GITLAB_SSH_PORT=10022' -e 'GITLAB_SECRETS_DB_KEY_BASE=long‐and‐random‐alpha‐numeric‐string' -e 'GITLAB_SECRETS_SECRET_KEY_BASE=long‐and‐random‐alpha‐numeric‐string' -e 'GITLAB_SECRETS_OTP_KEY_BASE=long‐and‐random‐alpha‐numeric‐string' -e 'GITLAB_HOST=192.168.101.64' ‐e 'SMTP_AUTHENTICATION=login' -v /home/root/opt/gitlab/data:/home/git/data docker.io/gitlab/gitlab-ce- 浏览器访问:http://[IP]:80 
 初次访问需要等待一段时间。
3 Idea 集成 GitLab
在 File => Settings => Plugins 里面 搜索 gitlab 安装,装好后点击File => Settings => Other Settings => GitLab Setting 这里面主要配置 GitLab Server Url 和你个人的私有访问 token
- 1 GitLab 简介
- 2 GitLab 安装- 2.1 CentOS 7 安装- 安装并配置必要的依赖项
- 添加 GitLab 软件包存储库并安装软件包
- 浏览到服务器 IP 并登录
 
- 2.2 Docker 安装
 
- 3 Idea 集成 GitLab


 
           
           
           

https://cway.top/?external_link=https%3A%2F%2Fbiuaxia.cn